diff --git a/lib/main.dart b/lib/main.dart index 3ffda4012..0eb4c224c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -11,6 +11,7 @@ import 'dart:async'; import 'dart:io'; import 'dart:math'; +import 'dart:ui'; import 'package:coinlib_flutter/coinlib_flutter.dart'; import 'package:compat/compat.dart' as lib_monero_compat; @@ -621,6 +622,21 @@ class _MaterialAppWithThemeState extends ConsumerState } } + @override + Future didRequestAppExit() async { + debugPrint("didRequestAppExit called"); + if (Platform.isMacOS) { + // On macOS, mwebd fails to shut down, hanging the app on close. + // + // Exiting is a hack fix for this issue. + + // await ref.read(pMwebService).shutdown(); + // Something like the above would probably be prudent to make. + exit(0); + } + return AppExitResponse.exit; + } + /// should only be called on android currently Future getOpenFile() async { // update provider with new file content state