Skip to content

Commit

Permalink
Window destroy on android and iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
bl1nch committed Nov 26, 2024
1 parent 5fb877b commit a42139f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/flet/lib/src/utils/desktop.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import 'dart:io';

import 'package:flet/src/utils/platform.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:window_manager/window_manager.dart';
import 'package:window_to_front/window_to_front.dart';
Expand Down Expand Up @@ -246,9 +249,15 @@ Future blurWindow() async {
}

Future destroyWindow() async {
if (isDesktopPlatform()) {
if (isDesktopPlatform() || isMobilePlatform()) {
debugPrint("destroyWindow()");
}
if (isDesktopPlatform()) {
await windowManager.destroy();
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
exit(0);
} else if (defaultTargetPlatform == TargetPlatform.android) {
SystemNavigator.pop();
}
}

Expand Down

0 comments on commit a42139f

Please sign in to comment.