widgets/macos_toolbar_passthrough library
A collection of widgets that intercept and handle native macOS toolbar events (e.g.: double-click to maximize, dragging to move window) so they can be processed within a Flutter app.
The issue: interacting (double-clicking or dragging) with the area within a flutter app where the native macOS toolbar would typically be triggers native actions like maximizing or moving the window. This is the expected behavior on "empty" areas, but undesirable when interacting with an input, such as a button.
This solution involves creating and managing invisible native macOS UI elements (Mainly NSViews) in Swift that intercept these events, preventing them from being processed natively and instead passing them to the Flutter engine for further handling.
Classes
- MacosToolbarPassthrough
- A widget that intercepts and handles native macOS toolbar events (e.g.: double-click to maximize, dragging to move window), forwarding them so they can be processed within Flutter only.
- MacosToolbarPassthroughScope
- An optional "scope" for toolbar items.
- MacosToolbarPassthroughState