infospectDesktopWindowOptions function
WindowOptions
infospectDesktopWindowOptions({})
Shared desktop window chrome for Infospect.
multiview_desktop's resetWindowToDefaults hides native min / max / close
buttons when WindowOptions.windowButtonVisibility is null. Always pass
these defaults for the host app and every Infospect secondary window.
When enableCloseShortcut is true (default), wraps the window shell so
⌘W / Ctrl+W closes this focused Infospect window.
Implementation
WindowOptions infospectDesktopWindowOptions({
String? title,
Size? size,
Size? minimumSize,
Size? maximumSize,
Alignment? alignment = Alignment.center,
Color? backgroundColor,
bool? fullScreen,
bool? alwaysOnTop,
ViewShellOverrides? shellOverrides,
bool enableCloseShortcut = true,
}) {
final ViewShellOverrides? merged;
if (!enableCloseShortcut) {
merged = shellOverrides;
} else {
merged = ViewShellOverrides.merge(
shellOverrides,
ViewShellOverrides(
builder: (context, child) {
final built =
shellOverrides?.builder?.call(context, child) ?? child;
return InfospectDesktopWindowShortcuts(
child: built ?? const SizedBox.shrink(),
);
},
),
);
}
return WindowOptions(
title: title,
size: size,
minimumSize: minimumSize,
maximumSize: maximumSize,
alignment: alignment,
backgroundColor: backgroundColor,
fullScreen: fullScreen,
alwaysOnTop: alwaysOnTop,
titleBarStyle: TitleBarStyle.normal,
windowButtonVisibility: true,
shellOverrides: merged,
);
}