complexDialog method

  1. @override
Widget complexDialog(
  1. AppModel app,
  2. BuildContext context, {
  3. bool? includeHeading,
  4. Key? key,
  5. required String title,
  6. required Widget child,
  7. VoidCallback? onPressed,
  8. String? buttonLabel,
  9. double? widthFraction,
})
override

Implementation

@override
Widget complexDialog(
  AppModel app,
  BuildContext context, {
  bool? includeHeading,
  Key? key,
  required String title,
  required Widget child,
  VoidCallback? onPressed,
  String? buttonLabel,
  double? widthFraction, // percentage of screen width
}) {
  return dialogHelper.build(
    app,
    context,
    width: widthFraction == null
        ? null
        : fullScreenWidth(context) * widthFraction,
    key: key,
    includeHeading: includeHeading,
    title: title,
    dialogButtonPosition: DialogButtonPosition.topRight,
    contents: child,
    buttons: dialogHelper.getCloseButton(app, context, onPressed: () {
      Navigator.of(context).pop();
      if (onPressed != null) {
        onPressed();
      }
    }, buttonLabel: buttonLabel),
    dialogBackgroundColor:
        _style.monaStyleAttributesModel.dialogBackgroundColor,
    dialogSeperatorColor:
        _style.monaStyleAttributesModel.dialogSeperatorColor,
  );
}