123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import 'package:cs_resources/generated/l10n.dart';
- import 'package:domain/entity/id_name_entity.dart';
- import 'package:flutter/material.dart';
- class SelectEstateState {
- //表单的校验与数据
- final Map<String, Map<String, dynamic>> formData;
- List<IdNameEntity>? 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<String, Map<String, dynamic>>? formData,
- }) : formData = formData ??
- {
- 'estate': {
- 'value': '',
- 'controller': TextEditingController(),
- 'hintText': S.current.type_here,
- 'focusNode': FocusNode(),
- 'obsecure': false,
- },
- };
- SelectEstateState copyWith({
- double? remainingSpace,
- List<IdNameEntity>? 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,
- );
- }
- }
|