In addition to that lower level control, the macos_ui package could provide a couple widgets that remove most of the onus from end-users.
First, a special version of SafeArea could be added to easily avoid the traffic lights:
// Imagine that this row is positioning things across the top of the window
Row(
children: [
// Adjust the first item so that its content is pushed away from
// the traffic lights.
TrafficLightsSafeArea(
child: Text("First"),
),
Text("Second"),
Text("Third"),
],
);
Second, an app bar container can simultaneously position the traffic lights, and avoid them:
MacAppBar(
height: // optional height, defers to intrinsic child size if not provided
background: // optional background widget that fills the space (including behind the traffic lights)
foreground: // optional foreground widget that fills the space (including in front of the traffic lights)
child: MyToolbar,
);
Every Mac desktop window has three little window control buttons, often called "traffic lights".
These buttons have a default appearance, but their location can be changed by the developer.
I filed https://github.com/macosui/macos_window_utils.dart/issues/27 to provide access to this info and behavior from Flutter.
In addition to that lower level control, the macos_ui package could provide a couple widgets that remove most of the onus from end-users.
First, a special version of
SafeArea
could be added to easily avoid the traffic lights:Second, an app bar container can simultaneously position the traffic lights, and avoid them: