selectionDialog method
Widget
selectionDialog(
- AppModel app,
- BuildContext context, {
- required String title,
- bool? includeHeading,
- Key? key,
- required List<
String> options, - required OnSelection onSelection,
- String? buttonLabel,
- double? widthFraction,
override
Implementation
@override
Widget selectionDialog(
AppModel app,
BuildContext context, {
required String title,
bool? includeHeading,
Key? key,
required List<String> options,
required OnSelection onSelection,
String? buttonLabel,
double? widthFraction, // percentage of screen width
}) {
return dialogHelper.build(
app,
context,
width: widthFraction == null
? null
: fullScreenWidth(context) * widthFraction,
key: key,
includeHeading: includeHeading,
dialogButtonPosition: DialogButtonPosition.topRight,
title: title,
buttons: dialogHelper.getCloseButton(app, context, onPressed: () {
Navigator.of(context).pop();
}),
contents: ListView.builder(
physics: ScrollPhysics(),
shrinkWrap: true,
itemCount: options.length,
itemBuilder: (context, i) {
return _style.frontEndStyle().buttonStyle().dialogButton(
app,
context,
label: options[i],
onPressed: () {
onSelection(i);
Navigator.of(context).pop();
},
);
}),
dialogBackgroundColor:
_style.monaStyleAttributesModel.dialogBackgroundColor,
dialogSeperatorColor:
_style.monaStyleAttributesModel.dialogSeperatorColor,
);
}