12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import 'package:cs_resources/generated/l10n.dart';
- import 'package:flutter/material.dart';
- class FeedbackCreateState {
- //表单的校验与数据
- final Map<String, Map<String, dynamic>> formData;
- //表单的错误信息展示
- String? titleErrorText;
- //类型选项
- final List<String> optionList = ["条件1", "条件2", "条件3", "条件4"];
- String? selectedOption;
- //选择的图片
- List<String> imgList;
- // =================================== Begin ↓ ===================================
- FeedbackCreateState({
- Map<String, Map<String, dynamic>>? formData,
- this.titleErrorText,
- required this.imgList,
- this.selectedOption,
- }) : formData = formData ??
- {
- 'title': {
- 'value': '',
- 'controller': TextEditingController(),
- 'focusNode': FocusNode(),
- 'obsecure': false,
- },
- 'desc': {
- 'value': '',
- 'controller': TextEditingController(),
- 'focusNode': FocusNode(),
- 'hintText': S.current.type_here,
- 'obsecure': false,
- },
- };
- FeedbackCreateState copyWith({
- String? titleErrorText,
- String? selectedOption,
- List<String>? imgList,
- }) {
- return FeedbackCreateState(
- formData: this.formData,
- titleErrorText: titleErrorText,
- imgList: imgList ?? this.imgList,
- selectedOption: selectedOption ?? this.selectedOption,
- );
- }
- }
|