You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1630105
Browse filesBrowse the repository at this point in the historyBrowse files
Sync with core 3cc8b3d: cancellable window close and application quit (#65)
- Every binding gets EventRequest / EventDecision with asynchronous,
retained delivery; Dart events cross native threads safely.
- JS keeps deliveries alive through Promise completion and cancels its
votes when its environment ends; Python pumps votes from asyncio.
- Real Flutter exit-confirmation and multi-window close ownership tests
(tools/gui), plus JS and Python event-loop regressions.
`app` must be a top-level or static function: it runs in an isolate of its own. On macOS that isolate lives on the process's first thread, the only one AppKit accepts, which the Dart VM otherwise keeps parked. The process ends when the app quits (`Application.instance.quit()`, Cmd+Q). See [`dart_view_example`](../../examples/dart_view_example) for a larger app built this way.
124
124
125
+
### Event listeners
126
+
127
+
Event listeners run on the isolate that registered them, including events emitted
128
+
from a native UI thread. A listener may return a `Future<void>`; its event payload
129
+
and borrowed objects remain valid until the callback finishes. Use an owned
130
+
`EventDecision` when confirmation must continue after the callback returns.
131
+
Removing a listener skips queued callbacks that have not started; an active
132
+
callback can finish its asynchronous work. Method callback parameters retain
133
+
their documented thread requirements.
134
+
135
+
The shared request primitives are available, but window close and application
136
+
quit producers are not yet connected to them.
137
+
125
138
## Examples
126
139
127
140
The examples are the `flutter_*` directories in the repository's [`examples/`](../../examples), plus [`dart_view_example`](../../examples/dart_view_example), a plain Dart program (`dart run bin/main.dart`). Each Flutter one is an app for one module; they resolve through the pub workspace at the repository root:
0 commit comments