diff --git a/packages/flet/lib/src/utils/desktop.dart b/packages/flet/lib/src/utils/desktop.dart index 5e2f21161..da8e321a0 100644 --- a/packages/flet/lib/src/utils/desktop.dart +++ b/packages/flet/lib/src/utils/desktop.dart @@ -1,7 +1,9 @@ +import 'dart:io'; import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:window_manager/window_manager.dart'; import 'package:window_to_front/window_to_front.dart'; +import 'package:flutter/services.dart'; import '../models/window_media_data.dart'; @@ -244,9 +246,15 @@ Future blurWindow() async { } Future destroyWindow() async { - if (isDesktop()) { + if (isDesktop() || isMobile()) { debugPrint("destroyWindow()"); + } + if (isDesktop()) { await windowManager.destroy(); + } else if (defaultTargetPlatform == TargetPlatform.iOS) { + exit(0); + } else if (defaultTargetPlatform == TargetPlatform.android) { + SystemNavigator.pop(); } }