implement AppLifecycleState when desktop support arrives #26

Open
opened 2021-03-24 21:47:53 +00:00 by erinn · 0 comments
Owner

Currently on desktop, Flwtch sometimes takes up to 16 seconds after closing the window (clicking the 'X') to provide time for Isolates to close... unfortunately our eventbus blocks and this never happens unless we're lucky with event timing.

Theoretically we would fix this by calling cwtch.dispose() when the app is closed, but Flutter doesn't support this code path directly yet (AppLifecycleState only functions correctly on an unknown subset of mobile platforms). We could wait for official support (github tracking), but the Flutter devs seem reluctant for some reason to believe they haven't implemented this feature yet.

Some of their closed/wontfix issue threads suggest we may be able to pipe an onClose notification from Kotlin to Flutter/Dart. Keeping in mind that this problem only occurs on desktop, it seems worth investigating when someone has the bandwidth. It may not even require piping to a handler, if eg we could respond to the onClose event with System.exit(0) or something immediately.....

Currently on desktop, Flwtch sometimes takes up to 16 seconds after closing the window (clicking the 'X') to provide time for Isolates to close... unfortunately our eventbus blocks and this never happens unless we're lucky with event timing. Theoretically we would fix this by calling cwtch.dispose() when the app is closed, but Flutter doesn't support this code path directly yet (AppLifecycleState only functions correctly on an unknown subset of mobile platforms). We could wait for official support ([github tracking](https://github.com/flutter/flutter/issues/30735)), but the Flutter devs seem reluctant for some reason to believe they haven't implemented this feature yet. Some of their closed/wontfix issue threads suggest we may be able to pipe an onClose notification from Kotlin to Flutter/Dart. Keeping in mind that this problem only occurs on desktop, it seems worth investigating when someone has the bandwidth. It may not even require piping to a handler, if eg we could respond to the onClose event with System.exit(0) or something immediately.....
sarah added the
blocked-on-external-dependency
label 2021-06-02 01:17:42 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: flutter/flutter_app#26
No description provided.