select_estate_state.dart 900 B

12345678910111213141516171819202122232425262728293031323334
  1. import 'package:cs_resources/generated/l10n.dart';
  2. import 'package:flutter/material.dart';
  3. class SelectEstateState {
  4. //表单的校验与数据
  5. final Map<String, Map<String, dynamic>> formData;
  6. double remainingSpace;
  7. // =================================== Begin ↓ ===================================
  8. SelectEstateState({
  9. this.remainingSpace = 0,
  10. Map<String, Map<String, dynamic>>? formData,
  11. }) : formData = formData ??
  12. {
  13. 'estate': {
  14. 'value': '',
  15. 'controller': TextEditingController(),
  16. 'hintText': S.current.type_here,
  17. 'focusNode': FocusNode(),
  18. 'obsecure': false,
  19. },
  20. };
  21. SelectEstateState copyWith({
  22. double? remainingSpace,
  23. }) {
  24. return SelectEstateState(
  25. remainingSpace: remainingSpace ?? this.remainingSpace,
  26. );
  27. }
  28. }