quit method

Future<bool> quit()

Implementation

Future<bool> quit() async {

  bool exit = true;

  // show warning if form is dirty?
  if (widget.model.dirty && widget.model.warnOnExit) {

    //var color = Theme.of(context).buttonTheme.colorScheme?.inversePrimary ?? Theme.of(context).colorScheme.inversePrimary;
    var color = Colors.black87;
    var no = Text(phrase.no,
        style: TextStyle(
            fontSize: 18, color: color, fontWeight: FontWeight.w600));
    var yes = Text(phrase.yes,
        style: TextStyle(
            fontSize: 18, color: color, fontWeight: FontWeight.w600));
    int? response = await widget.model.framework?.show(
        type: DialogType.info,
        title: phrase.continueQuitting,
        buttons: [no, yes]);
    exit = (response == 1);
  }
  return exit;
}