foodModeFormEntry method
Widget
foodModeFormEntry(
{ - String title = 'Food Mode',
- String subTitle = 'Select the food modes available',
- dynamic onSeatingChanged(
- bool?
)?,
- dynamic onDeliveryChanged(
- bool?
)?,
- bool hasSeating = false,
- bool hasDelivery = false,
})
Implementation
Widget foodModeFormEntry({
String title = 'Food Mode',
String subTitle = 'Select the food modes available',
Function(bool?)? onSeatingChanged,
Function(bool?)? onDeliveryChanged,
bool hasSeating = false,
bool hasDelivery = false,
}) {
return formEntry(
title: title,
subTitle: subTitle,
inputWidget: Flex(
direction: Axis.vertical,
children: [
CheckboxListTile(
visualDensity: VisualDensity.compact,
title: Text(
'Dine-In',
style: Theme.of(context).textTheme.bodyLarge,
),
value: hasSeating,
enabled: isEdit,
onChanged: (value) {
onSeatingChanged!(value);
widget.formKey.currentState!.save();
if (widget.onModified != null) {
widget.onModified!();
}
},
),
SizedBox(height: smallPadding),
CheckboxListTile(
enabled: isEdit,
visualDensity: VisualDensity.compact,
title: Text(
'Delivery',
style: Theme.of(context).textTheme.bodyLarge,
),
value: hasDelivery,
onChanged: (value) {
onDeliveryChanged!(value);
widget.formKey.currentState!.save();
if (widget.onModified != null) {
widget.onModified!();
}
},
),
],
),
);
}