When using a custom window frame (BDW_CUSTOM_FRAME), you must provide your own UI for moving the window and controlling its state (minimize, maximize, close).
Key widgets provided by bitsdojo_window:
Window Movement
MoveWindow: A widget that allows the user to click and drag to move the window. Typically used inside a WindowTitleBarBox.
Window Buttons
WindowButtons: A collection of window control buttons.MinimizeWindowButton: A button to minimize the window. Accepts a colors parameter of type WindowButtonColors.MaximizeWindowButton: A button to maximize/restore the window. Accepts a colors parameter of type WindowButtonColors.CloseWindowButton: A button to close the window. Accepts a colors parameter of type WindowButtonColors.
Layout Helpers
WindowTitleBarBox: A container used to house the title bar area.WindowBorder: A widget to draw a border around your application content.
Configuration
WindowButtonColors: Defines the color states for window buttons:iconNormalmouseOvermouseDowniconMouseOvericonMouseDown
// Example of a custom title bar with movement and buttons
WindowTitleBarBox(
child: Row(
children: [
Expanded(child: MoveWindow()),
const WindowButtons(),
],
),
)
// Example of custom window buttons
class WindowButtons extends StatelessWidget {
const WindowButtons({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Row(
children: [
MinimizeWindowButton(colors: myButtonColors),
MaximizeWindowButton(colors: myButtonColors),
CloseWindowButton(colors: myCloseButtonColors),
],
);
}
}