quit method

Future<bool> quit()

Implementation

Future<bool> quit() async {
  WidgetModel.unfocus();
  bool exit = true;
  bool dirty = widget.model.dirty!;

  if (dirty) {
    int? response = await widget.model.framework
        ?.show(type: DialogType.info, title: phrase.saveBeforeExit, buttons: [
      Text(phrase.yes,
          style: TextStyle(
              fontSize: 18, color: Theme.of(context).colorScheme.outline)),
      Text(phrase.no,
          style: TextStyle(
              fontSize: 18, color: Theme.of(context).colorScheme.outline))
    ]);
    exit = (response == 1);
  }
  return exit;
}