Skip to content

Commit aae1458

Browse files
committed
Window destroy on android and iOS
1 parent aa7148b commit aae1458

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/flet/lib/src/utils/desktop.dart

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:flutter/foundation.dart';
22
import 'package:flutter/widgets.dart';
33
import 'package:window_manager/window_manager.dart';
44
import 'package:window_to_front/window_to_front.dart';
5+
import 'package:flutter/services.dart';
56

67
import '../models/window_media_data.dart';
78

@@ -244,9 +245,15 @@ Future blurWindow() async {
244245
}
245246

246247
Future destroyWindow() async {
247-
if (isDesktop()) {
248+
if (isDesktop() || isMobile()) {
248249
debugPrint("destroyWindow()");
250+
}
251+
if (isDesktop()) {
249252
await windowManager.destroy();
253+
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
254+
exit(0);
255+
} else if (defaultTargetPlatform == TargetPlatform.android) {
256+
SystemNavigator.pop();
250257
}
251258
}
252259

0 commit comments

Comments
 (0)