build method
Implementation
Widget build(
String key,
value,
Widget? widget,
Function(String) updateItem,
Function(String?) saveItem,
) {
if (widget == null) {
var controller = TextEditingController(
text: '${value ?? ''}',
);
var inputDecoration =
options.inputDecorationField?[key] ?? options.inputDecoration;
var formFieldKey = GlobalKey<FormFieldState>();
return TextFormField(
style: options.inputTextStyle,
keyboardType: options.keyboardType?[key],
key: formFieldKey,
controller: controller,
decoration: inputDecoration,
readOnly: options.readOnly,
onFieldSubmitted: (value) {
updateItem(value);
},
onSaved: (newValue) {
saveItem(newValue);
},
validator: (value) => options.validators?[key]?.call(value),
);
}
return widget;
}