import 'package:flutter/material.dart';

class SelectUnitState {
  //表单的校验与数据
  final Map<String, Map<String, dynamic>> formData;

  double remainingSpace;

  // ===================================  Begin  ↓  ===================================

  SelectUnitState({
    this.remainingSpace = 0,
    Map<String, Map<String, dynamic>>? formData,
  }) : formData = formData ??
            {
              'block': {
                'value': '',
                'controller': TextEditingController(),
                'hintText': '',
                'focusNode': FocusNode(),
                'obsecure': false,
              },
              'unit': {
                'value': '',
                'controller': TextEditingController(),
                'hintText': '',
                'focusNode': FocusNode(),
                'obsecure': false,
              },
              'room': {
                'value': '',
                'controller': TextEditingController(),
                'hintText': '',
                'focusNode': FocusNode(),
                'obsecure': false,
              },
            };

  SelectUnitState copyWith({
    double? remainingSpace,
  }) {
    return SelectUnitState(
      remainingSpace: remainingSpace ?? this.remainingSpace,
    );
  }

}
