descriptionFormEntry method
Widget
descriptionFormEntry(
{ - String title = 'Description',
- String subTitle = 'the description of your meal that will be displayed below the name',
- dynamic onSaved(
- String?
)?,
- dynamic onChanged(
- String?
)?,
- int maxLines = 1,
- String? defaultValue,
})
Implementation
Widget descriptionFormEntry({
String title = 'Description',
String subTitle =
'the description of your meal that will be displayed below the name',
Function(String?)? onSaved,
Function(String?)? onChanged,
int maxLines = 1,
String? defaultValue,
}) {
return formEntry(
title: title,
subTitle: subTitle,
inputWidget: TextFormField(
maxLines: maxLines,
onChanged: (value) {
widget.formKey.currentState!.save();
if (widget.onModified != null) {
widget.onModified!();
}
onChanged?.call(value);
},
style: Theme.of(context).textTheme.bodyLarge,
enabled: isEdit,
controller: TextEditingController(text: defaultValue),
decoration: elegantInputDecoration(
hintText: 'Description',
prefix: const Icon(Icons.description),
).copyWith(alignLabelWithHint: true),
onSaved: onSaved,
),
);
}