import 'package:cs_resources/generated/l10n.dart'; import 'package:domain/entity/id_name_entity.dart'; import 'package:flutter/material.dart'; class SelectEstateState { //表单的校验与数据 final Map> formData; List? estateList; //第一步的下拉选房产数据源 IdNameEntity? selectedEstate; //第一步数据:已经选中的房产 String? block; //第二步数据:已经选中的Block String? unit; //第二步数据:已经选中的单元 String? room; //第二步数据:已经选中的单元-房间 String? type; //第三步数据:已经选中的类型 // =================================== Begin ↓ =================================== SelectEstateState({ this.estateList, this.selectedEstate, this.block, this.unit, this.room, this.type, Map>? formData, }) : formData = formData ?? { 'estate': { 'value': '', 'controller': TextEditingController(), 'hintText': S.current.type_here, 'focusNode': FocusNode(), 'obsecure': false, }, }; SelectEstateState copyWith({ double? remainingSpace, List? estateList, IdNameEntity? selectedEstate, String? block, String? unit, String? room, String? type, }) { return SelectEstateState( estateList: estateList ?? this.estateList, selectedEstate: selectedEstate ?? this.selectedEstate, block: block ?? this.block, unit: unit ?? this.unit, room: room ?? this.room, type: type ?? this.type, formData: this.formData, ); } }