apply_state.dart 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import 'package:cs_resources/generated/l10n.dart';
  2. import 'package:domain/entity/form_content_entity.dart';
  3. import 'package:domain/entity/form_list_entity.dart';
  4. import 'package:domain/entity/form_option_entity.dart';
  5. import 'package:flutter/material.dart';
  6. class ApplyState {
  7. int detailPageIndex;
  8. //表单类型(列表的Form类型)
  9. String? formType;
  10. String? estateFormId;
  11. //该房产小区对应的此 Form 信息,从Apply 的列表item中拿过来
  12. FormListEntity? formItem;
  13. //是否可编辑
  14. bool enableEdit;
  15. //页面组的信息
  16. Map<String, dynamic>? detailPage;
  17. //复显的详情数据(来自网络数据)
  18. FormContentEntity formContentDetail;
  19. FormOptionEntity? formOption;
  20. ApplyState({
  21. this.formType,
  22. this.estateFormId,
  23. this.formItem,
  24. this.detailPage,
  25. this.formOption,
  26. required this.formContentDetail,
  27. this.enableEdit = true,
  28. this.detailPageIndex = 0,
  29. });
  30. ApplyState copyWith({
  31. String? formType,
  32. String? estateFormId,
  33. FormListEntity? formItem,
  34. bool? enableEdit,
  35. Map<String, dynamic>? detailPage,
  36. FormContentEntity? formContentDetail,
  37. FormOptionEntity? formOption,
  38. }) {
  39. return ApplyState(
  40. formType: formType ?? this.formType,
  41. estateFormId: estateFormId ?? this.estateFormId,
  42. formItem: formItem ?? this.formItem,
  43. enableEdit: enableEdit ?? this.enableEdit,
  44. detailPage: detailPage ?? this.detailPage,
  45. formContentDetail: formContentDetail ?? this.formContentDetail,
  46. formOption: formOption ?? this.formOption,
  47. detailPageIndex: this.detailPageIndex,
  48. );
  49. }
  50. }