value property

Map<String, dynamic> get value

get form value

will not contains value of disabled fields

Implementation

Map<String, dynamic> get value {
  final Map<String, dynamic> map = <String, dynamic>{};
  for (final FormeFieldState element in _states) {
    if (!element.enabled || element.name == null) {
      continue;
    }
    final String name = element.name!;
    final dynamic value = element.value;
    map[name] = value;
  }

  // Author (Lvyan): 添加除了field之外的value
  _formValue.addAll(map);
  return map;
}
set value (Map<String, dynamic> data)

set form value

Implementation

set value(Map<String, dynamic> data) {
  _formValue.clear();
  data.forEach((key, dynamic value) {
    maybeField(key)?.value = value;
    _formValue[key] = value;
  });
}