create method

Future<bool> create({
  1. required String title,
  2. required String message,
  3. required String okLabel,
  4. required String cancelLabel,
  5. required BuildContext context,
})

Implementation

Future<bool> create(
    {required String title,
    required String message,
    required String okLabel,
    required String cancelLabel,
    required BuildContext context}) async {
  bool? dialogReturn = await showDialog<bool>(
    context: context,
    barrierDismissible: false,
    builder: (BuildContext context) {
      return AlertDialog(
        content: SingleChildScrollView(
          child: ListBody(children: <Widget>[
            _getIcon(),
            _getTitle(title),
            _getMessage(message)
          ]),
        ),
        actions: _getButtons(context, okLabel, cancelLabel),
      );
    },
  );
  return dialogReturn == true;
}