ModalOverlay class

A specialized, high Z-index container that traps focus and intercepts mouse events.

Inheritance

Constructors

ModalOverlay({required String title, required int width, required int height, required Rect dialogBounds, required Widget child, required List<FocusNode> modalFocusNodes, void onDismiss()?, Style scrimStyle = const Style(modifiers: Modifier.dim), FocusScopeNode? focusNode, Style borderStyle = Style.empty, Style titleStyle = Style.empty, Style backgroundStyle = Style.empty, bool onKeyEvent(KeyEvent event)?})
Creates a ModalOverlay widget that traps focus within its bounds.
factory

Properties

backgroundStyle Style
The background style of the window.
finalinherited
borderChars List<String>
The characters used to draw the window borders.
finalinherited
borderStyle Style
The style applied to the window borders.
finalinherited
child Widget
The child widget displayed inside the window.
finalinherited
customOnKeyEvent bool Function(KeyEvent event)?
An optional custom key event handler for unhandled events in the modal.
final
dialogBounds Rect
The physical bounding box of the central dialog.
final
focusNode FocusNode
The focus node representing this window's focus state.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
height int
The height of the window.
getter/setter pairinherited
key Key?
The optional key for this widget.
finalinherited
modalFocusNodes List<FocusNode>
The list of child focus nodes managed by this modal.
final
onDismiss → void Function()?
A callback invoked when the user attempts to dismiss the modal (e.g. clicking outside).
final
onKeyEvent → void Function(KeyEvent event)?
Callback triggered when a keyboard event is routed to this window.
no setteroverride
onMouseEvent → void Function(MouseEvent event, int localX, int localY)?
Callback triggered when a mouse event hits this window.
no setteroverride
onPan → void Function(int dx, int dy)?
Callback triggered when the window is dragged.
finalinherited
onResize → void Function(int dx, int dy)?
Callback triggered when the window is resized.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrimStyle Style
The styling for the dimming overlay behind the dialog.
final
showCloseButton bool
Whether to show the close button x on the top right.
finalinherited
title String
The title text shown in the window border.
finalinherited
titleStyle Style
The style applied to the window title.
finalinherited
width int
The width of the window.
getter/setter pairinherited

Methods

createElement() Element
Creates an Element to manage this widget's location in the tree.
override
getIntrinsicHeight(int width) int
Computes the intrinsic height of this widget under the given width constraint.
inherited
getIntrinsicWidth(int height) int
Computes the intrinsic width of this widget under the given height constraint.
inherited
isPositionOnTitle(int localX, int localY) bool
Returns true if the local coordinates localX and localY lie on the title text.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited