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 Jul 11, 2024
1 parent aa7148b commit aae1458
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/flet/lib/src/utils/desktop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ 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';

Expand Down Expand Up @@ -244,9 +245,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();
}
}

Expand Down

0 comments on commit aae1458

Please sign in to comment.