show method

Future<void> show({
  1. String? title,
  2. Option? button01,
  3. Option? button02,
  4. VoidCallback? press01,
  5. VoidCallback? press02,
  6. bool? switchButtons,
  7. String? msg,
  8. List<Widget>? body,
  9. List<Widget>? actions,
  10. bool? barrierDismissible,
})

Display the Dialog window.

Implementation

Future<void> show({
  String? title,
  Option? button01,
  Option? button02,
  VoidCallback? press01,
  VoidCallback? press02,
  bool? switchButtons,
  String? msg,
  List<Widget>? body,
  List<Widget>? actions,
  bool? barrierDismissible,
}) {
  title = title ?? this.title;
  title ??= '';
  this.button01 ??= button01;
  this.button02 ??= button02;
  this.press01 ??= press01;
  this.press02 ??= press02;
  this.switchButtons ??= switchButtons;
  body = body ?? this.body;
  body ??= [const SizedBox()];
  actions ??= this.actions;
  actions ??= _listOptions();
  barrierDismissible ??= this.barrierDismissible ?? false;
  return showDialog<void>(
    context: App.context!,
    barrierDismissible: barrierDismissible,
    builder: (BuildContext context) => AlertDialog(
      title: Text(title!),
      content: SingleChildScrollView(
        child: ListBody(
          children: body!,
        ),
      ),
      actions: actions,
    ),
  );
}