ConfigFormController class

Inheritance

Constructors

ConfigFormController()

Properties

errors Map<String, String>
获取错误信息
no setter
formData Map<String, dynamic>
获取表单数据
no setter
formKey GlobalKey<FormState>?
获取表单键
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
clearAllFields() → void
清空所有字段值
clearFieldError(String fieldName) → void
清除字段错误
clearFieldValue(String fieldName) → void
清空字段值
dispose() → void
Discards any resources used by the object.
inherited
getFormData() Map<String, dynamic>
获取表单数据
getValue<T>(String fieldName) → T?
获取字段值
initializeData(Map<String, dynamic> initialData) → void
初始化表单数据
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
reset() → void
重置表单
resetFieldsToDefault(List<String> fieldNames) → void
批量重置字段为默认值
resetFieldToDefault(String fieldName) → void
重置字段为默认值
save([List<FormConfig>? configs]) Map<String, dynamic>?
保存表单(验证并获取数据)
setConfigs(List<FormConfig> configs) → void
设置表单配置
setFieldError(String fieldName, String error) → void
设置字段错误
setFieldValue(String fieldName, dynamic value) → void
设置字段值
setFieldValues(Map<String, dynamic> values) → void
批量设置字段值
setFormKey(GlobalKey<FormState> formKey) → void
内部方法,由ConfigForm组件调用
setOnChanged(dynamic onChanged(Map<String, dynamic>)?) → void
toString() String
A string representation of this object.
inherited
updateField(String fieldName, dynamic value) → void
更新字段值
validate([List<FormConfig>? configs]) bool
验证表单

Operators

operator ==(Object other) bool
The equality operator.
inherited