-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Window destroy on android and iOS #3733
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -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()"); | ||||||||||||||||||||
} | ||||||||||||||||||||
Comment on lines
248
to
+251
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Consider renaming the function to reflect its expanded functionality The
Suggested change
|
||||||||||||||||||||
if (isDesktop()) { | ||||||||||||||||||||
await windowManager.destroy(); | ||||||||||||||||||||
} else if (defaultTargetPlatform == TargetPlatform.iOS) { | ||||||||||||||||||||
exit(0); | ||||||||||||||||||||
FeodorFitsner marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||
} else if (defaultTargetPlatform == TargetPlatform.android) { | ||||||||||||||||||||
SystemNavigator.pop(); | ||||||||||||||||||||
} | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Remove redundant platform check as all cases are handled specifically.
The
isDesktop() || isMobile()
check is no longer necessary since all platforms are handled in the subsequent conditions. Consider removing this check and keeping only the debug print statement outside of any condition.