WindowManagerPlus class
WindowManagerPlus
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether the window has listeners.
no setter
- id → int
-
no setter
-
listeners
→ List<
WindowListener> -
Get the window listeners.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
WindowListener listener) → void - Add a listener to the window.
-
blur(
) → Future< void> - Removes focus from the window.
-
center(
{bool animate = false}) → Future< void> - Moves window to the center of the screen.
-
close(
) → Future< void> - Try to close the window.
-
destroy(
) → Future< void> - Force closing the window.
-
dock(
{required DockSide side, required int width}) → Future< void> - Docks the window. only works on Windows
-
focus(
) → Future< void> - Focuses on the window.
-
getBounds(
) → Future< Rect> -
Returns
Rect
- The bounds of the window as Object. -
getDevicePixelRatio(
) → double - Get the device pixel ratio.
-
getOpacity(
) → Future< double> -
Returns
double
- between 0.0 (fully transparent) and 1.0 (fully opaque). -
getPosition(
) → Future< Offset> -
Returns
Offset
- Contains the window's current position. -
getSize(
) → Future< Size> -
Returns
Size
- Contains the window's width and height. -
getTitle(
) → Future< String> -
Returns
String
- The title of the native window. -
getTitleBarHeight(
) → Future< int> -
Returns
int
- The title bar height of the native window. -
hasShadow(
) → Future< bool> -
Returns
bool
- Whether the window has a shadow. On Windows, always returns true unless window is frameless. -
hide(
) → Future< void> - Hides the window.
-
invokeMethodToWindow(
int targetWindowId, String method, [dynamic args]) → Future -
Invokes a method on the window with id
targetWindowId
. It could return a Future that resolves to the return value of the invoked method, otherwisenull
. Use WindowListener.onEventFromWindow to listen for the event. -
isAlwaysOnBottom(
) → Future< bool> -
Returns
bool
- Whether the window is always below other windows. -
isAlwaysOnTop(
) → Future< bool> -
Returns
bool
- Whether the window is always on top of other windows. -
isClosable(
) → Future< bool> -
Returns
bool
- Whether the window can be manually closed by user. -
isDockable(
) → Future< bool> -
Returns
bool
- Whether the window is dockable or not. -
isDocked(
) → Future< DockSide?> -
Returns
bool
- Whether the window is docked. -
isFocused(
) → Future< bool> -
Returns
bool
- Whether window is focused. -
isFullScreen(
) → Future< bool> -
Returns
bool
- Whether the window is in fullscreen mode. -
isMaximizable(
) → Future< bool> -
Returns
bool
- Whether the window can be manually maximized by the user. -
isMaximized(
) → Future< bool> -
Returns
bool
- Whether the window is maximized. -
isMinimizable(
) → Future< bool> -
Returns
bool
- Whether the window can be manually minimized by the user. -
isMinimized(
) → Future< bool> -
Returns
bool
- Whether the window is minimized. -
isMovable(
) → Future< bool> -
Returns
bool
- Whether the window can be moved by user. -
isPreventClose(
) → Future< bool> - Check if is intercepting the native close signal.
-
isResizable(
) → Future< bool> -
Returns
bool
- Whether the window can be manually resized by the user. -
isSkipTaskbar(
) → Future< bool> -
Returns
bool
- Whether skipping taskbar is enabled. -
isVisible(
) → Future< bool> -
Returns
bool
- Whether the window is visible to the user. -
isVisibleOnAllWorkspaces(
) → Future< bool> -
Returns
bool
- Whether the window is visible on all workspaces. -
maximize(
{bool vertically = false}) → Future< void> -
Maximizes the window.
vertically
simulates aero snap, only works on Windows -
minimize(
) → Future< void> - Minimizes the window. On some platforms the minimized window will be shown in the Dock.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
popUpWindowMenu(
) → Future< void> -
removeListener(
WindowListener listener) → void - Remove a listener from the window.
-
restore(
) → Future< void> - Restores the window from minimized state to its previous state.
-
setAlignment(
Alignment alignment, {bool animate = false}) → Future< void> - Move the window to a position aligned with the screen.
-
setAlwaysOnBottom(
bool isAlwaysOnBottom) → Future< void> - Sets whether the window should show always below other windows.
-
setAlwaysOnTop(
bool isAlwaysOnTop) → Future< void> - Sets whether the window should show always on top of other windows.
-
setAsFrameless(
) → Future< void> - You can call this to remove the window frame (title bar, outline border, etc), which is basically everything except the Flutter view, also can call setTitleBarStyle(TitleBarStyle.normal) or setTitleBarStyle(TitleBarStyle.hidden) to restore it.
-
setAspectRatio(
double aspectRatio) → Future< void> - This will make a window maintain an aspect ratio.
-
setBackgroundColor(
Color backgroundColor) → Future< void> - Sets the background color of the window.
-
setBadgeLabel(
[String? label]) → Future< void> - Set/unset label on taskbar(dock) app icon
-
setBounds(
Rect? bounds, {Offset? position, Size? size, bool animate = false}) → Future< void> - Resizes and moves the window to the supplied bounds.
-
setBrightness(
Brightness brightness) → Future< void> - Sets the brightness of the window.
-
setClosable(
bool isClosable) → Future< void> - Sets whether the window can be manually closed by user.
-
setFullScreen(
bool isFullScreen) → Future< void> - Sets whether the window should be in fullscreen mode.
-
setHasShadow(
bool hasShadow) → Future< void> - Sets whether the window should have a shadow. On Windows, doesn't do anything unless window is frameless.
-
setIcon(
String iconPath) → Future< void> - Sets window/taskbar icon.
-
setIgnoreMouseEvents(
bool ignore, {bool forward = false}) → Future< void> - Makes the window ignore all mouse events.
-
setMaximizable(
bool isMaximizable) → Future< void> - Sets whether the window can be manually maximized by the user.
-
setMaximumSize(
Size size) → Future< void> -
Sets the maximum size of window to
width
andheight
. -
setMinimizable(
bool isMinimizable) → Future< void> - Sets whether the window can be manually minimized by user.
-
setMinimumSize(
Size size) → Future< void> -
Sets the minimum size of window to
width
andheight
. -
setMovable(
bool isMovable) → Future< void> - Sets whether the window can be moved by user.
-
setOpacity(
double opacity) → Future< void> - Sets the opacity of the window.
-
setPosition(
Offset position, {bool animate = false}) → Future< void> - Moves window to position.
-
setPreventClose(
bool isPreventClose) → Future< void> - Set if intercept the native close signal. May useful when combine with the onclose event listener. This will also prevent the manually triggered close event.
-
setProgressBar(
double progress) → Future< void> -
Sets progress value in progress bar. Valid range is
[0, 1.0]
. -
setResizable(
bool isResizable) → Future< void> - Sets whether the window can be manually resized by the user.
-
setSize(
Size size, {bool animate = false}) → Future< void> -
Resizes the window to
width
andheight
. -
setSkipTaskbar(
bool isSkipTaskbar) → Future< void> - Makes the window not show in the taskbar / dock.
-
setTitle(
String title) → Future< void> - Changes the title of native window to title.
-
setTitleBarStyle(
TitleBarStyle titleBarStyle, {bool windowButtonVisibility = true}) → Future< void> - Changes the title bar style of native window.
-
setVisibleOnAllWorkspaces(
bool visible, {bool? visibleOnFullScreen}) → Future< void> - Sets whether the window should be visible on all workspaces.
-
show(
{bool inactive = false}) → Future< void> - Shows and gives focus to the window.
-
startDragging(
) → Future< void> - Starts a window drag based on the specified mouse-down event. On Windows, this is disabled during full screen mode.
-
startResizing(
ResizeEdge resizeEdge) → Future< void> - Starts a window resize based on the specified mouse-down & mouse-move event. On Windows, this is disabled during full screen mode.
-
toString(
) → String -
A string representation of this object.
override
-
undock(
) → Future< bool> - Undocks the window. only works on Windows
-
unmaximize(
) → Future< void> - Unmaximizes the window.
-
waitUntilReadyToShow(
[WindowOptions? options, VoidCallback? callback]) → Future< void> - Wait until ready to show.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- current → WindowManagerPlus
-
The current instance of WindowManagerPlus.
ensureInitialized must be called before accessing this.
no setter
-
globalListeners
→ List<
WindowListener> -
Get the global window listeners.
no setter
- hasGlobalListeners → bool
-
Whether the window has global listeners.
no setter
Static Methods
-
addGlobalListener(
WindowListener listener) → void - Add a global listener to the window.
-
createWindow(
[List< String> ? args]) → Future<WindowManagerPlus?> - Create a new window.
-
ensureInitialized(
int windowId) → Future< void> -
Ensure the window manager for this
windowId
is initialized. Must be called before accessing the WindowManagerPlus.current. -
fromWindowId(
int windowId) → WindowManagerPlus - Get the window manager from the window id.
-
getAllWindowManagerIds(
) → Future< List< int> > - Get all window manager ids.
-
removeGlobalListener(
WindowListener listener) → void - Remove a global listener from the window.