form<T> static method
get field data by context context must be include in SparkFormItem
Implementation
static T form<T>(BuildContext context, String field) {
SparkFormItemData? _data =
context.dependOnInheritedWidgetOfExactType<SparkFormData>()?.formData;
if (_data == null) {
throw UnsupportedError('context range error');
}
Map<String, FormGroupItem> _fieldList = _data.manage.manageList;
if (!_fieldList.containsKey(field)) {
throw ArgumentError('$field is not exit in manage');
}
return _fieldList[field]!.getValue();
}