select_unit_state.dart 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import 'package:flutter/material.dart';
  2. class SelectUnitState {
  3. // //表单的校验与数据
  4. // final Map<String, Map<String, dynamic>> formData;
  5. //
  6. // // =================================== Begin ↓ ===================================
  7. //
  8. // SelectUnitState({
  9. // Map<String, Map<String, dynamic>>? formData,
  10. // }) : formData = formData ??
  11. // {
  12. // 'block': {
  13. // 'value': '',
  14. // 'controller': TextEditingController(),
  15. // 'hintText': '',
  16. // 'focusNode': FocusNode(),
  17. // 'obsecure': false,
  18. // },
  19. // 'unit': {
  20. // 'value': '',
  21. // 'controller': TextEditingController(),
  22. // 'hintText': '',
  23. // 'focusNode': FocusNode(),
  24. // 'obsecure': false,
  25. // },
  26. // 'room': {
  27. // 'value': '',
  28. // 'controller': TextEditingController(),
  29. // 'hintText': '',
  30. // 'focusNode': FocusNode(),
  31. // 'obsecure': false,
  32. // },
  33. // };
  34. String? selectedUnitId;
  35. String? selectedUnitName;
  36. SelectUnitState({
  37. this.selectedUnitId,
  38. this.selectedUnitName,
  39. });
  40. SelectUnitState copyWith({
  41. String? selectedUnitId,
  42. String? selectedUnitName,
  43. }) {
  44. return SelectUnitState(
  45. selectedUnitId: selectedUnitId ?? this.selectedUnitId,
  46. selectedUnitName: selectedUnitName ?? this.selectedUnitName,
  47. );
  48. }
  49. }