File tree 1 file changed +10
-1
lines changed
packages/flet/lib/src/utils
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change
1
+ import 'dart:io' ;
2
+
1
3
import 'package:flet/src/utils/platform.dart' ;
2
4
import 'package:flutter/foundation.dart' ;
5
+ import 'package:flutter/services.dart' ;
3
6
import 'package:flutter/widgets.dart' ;
4
7
import 'package:window_manager/window_manager.dart' ;
5
8
import 'package:window_to_front/window_to_front.dart' ;
@@ -246,9 +249,15 @@ Future blurWindow() async {
246
249
}
247
250
248
251
Future destroyWindow () async {
249
- if (isDesktopPlatform ()) {
252
+ if (isDesktopPlatform () || isMobilePlatform () ) {
250
253
debugPrint ("destroyWindow()" );
254
+ }
255
+ if (isDesktopPlatform ()) {
251
256
await windowManager.destroy ();
257
+ } else if (defaultTargetPlatform == TargetPlatform .iOS) {
258
+ exit (0 );
259
+ } else if (defaultTargetPlatform == TargetPlatform .android) {
260
+ SystemNavigator .pop ();
252
261
}
253
262
}
254
263
You can’t perform that action at this time.
0 commit comments