multiview_desktop library

Multi-window support for Flutter desktop.

All OS windows share one Flutter engine and one Dart isolate.

Entry point: runMultiApp instead of runApp:

void main() {
  runMultiApp(home: (context, id) => MyApp());
}

Open another window from anywhere:

openWindow((context, id) => const SettingsPage(), options: WindowOptions(title: 'Settings'));

Control the current window via MultiViewDesktop.of or MultiViewDesktop.fromId:

final win = MultiViewDesktop.of(context);
await win.setTitle('Settings');
await win.setTitleBarStyle(TitleBarStyle.hidden);

See also WindowListener, WindowCommunicator, and WindowOptions.

Classes

AppShellController
Controls the shared entry shell used on secondary and dialog views.
AppShellPatch
Partial update applied through AppShellController.patch.
AppShellSnapshot
Immutable app-wide settings shared by secondary and dialog views.
DialogModalLayer
Semi-transparent overlay over a parent window while a modal dialog is open.
DialogOptions
Configuration for a dialog opened via openDialog.
DialogScope
DragToMoveArea
Makes its child area draggable to move the current window.
DragToResizeArea
Starts a native window resize when the user drags this area.
MacosPlatformParams
macOS-specific parameters for MultiAppConfig.macosParams.
MultiAppConfig
Application-wide settings passed to runMultiApp.
MultiPlatformParams
Cross-platform parameters for MultiAppConfig.generalParams.
MultiViewDesktop
ParentWindowScope
Exposes the parent BuildContext for a dialog or secondary window.
TaskbarMenuItem
Custom entry for the app taskbar / dock context menu.
ViewShellOverrides
Per-view entry shell configuration for a secondary or dialog View.
WindowCaption
A custom title-bar replacement for frameless windows.
WindowCommunicator
In-process message bus between views.
WindowListenerCallbacks
Callback surface used by the library to deliver native window events.
WindowObserver
Observer for native window lifecycle events in a multiview_desktop application.
WindowOptions
Pass to openWindow to control initial appearance and position.

Enums

AppEntryKind
Which root widget type is mirrored on secondary and dialog views.
CloseMode
How closing the main window affects other open windows.
ResizeEdge
Edge or corner used when starting a native resize drag (DragToResizeArea).
TitleBarStyle
Native title-bar appearance for an OS window.

Mixins

WindowListener<T extends StatefulWidget>
State mixin that registers WindowListenerCallbacks for the current window.

Extensions

MvdContext on BuildContext

Constants

kWindowCaptionHeight → const double
Standard height of the custom window caption bar.

Functions

openDialog<T>(Widget childBuilder(BuildContext context, int publicId), {required BuildContext parentContext, DialogOptions? options}) Future<T?>
Opens a dialog window tied to parentContext.
openWindow(Widget childBuilder(BuildContext context, int publicId), {WindowOptions? options, BuildContext? parentContext}) Future<int>
Opens a new OS window showing childBuilder.
runMultiApp({required Widget home(BuildContext context, int publicId), Widget globalScope(Widget child)?, MultiAppConfig? config}) → void
Entry point for a multiview_desktop application.

Typedefs

DialogInfo = ({int id, bool isModal})
Tracks open child dialogs for one OS window.
WindowInfo = ({bool isDialog, bool isModal})
Per-window facade for native window operations.