OpenModalAction class final
Shows a screen (canvas) as a modal: a dialog, a sheet, a popover. The
CloseModalAction that closes it gives the chain that opened it its
${result}. JSON: {"type": "openModal", "to": "canvas-d", "presentation": "bottomSheet"}.
- Inheritance
-
- Object
- ActionDef
- CoreAction
- OpenModalAction
Constructors
-
OpenModalAction({String to = '', Json params = const {}, ModalPresentation presentation = ModalPresentation.dialog, bool barrierDismissible = true, Color? barrierColor, double barrierBlur = 0, bool showDragHandle = false, List<
double> alignment = const [0, 0], ModalAnchor anchor = ModalAnchor.none, PopoverPlacement placement = PopoverPlacement.belowStart, double anchorGap = 4, double anchorOffset = 0, double anchorReserve = 0, bool popoverArrow = false, bool hoverCard = false, int hoverDelayMs = 0, String anchorNode = '', String anchorItem = '', List<double> insets = const [0, 0, 0, 0], double? sheetWidth, SheetSide sheetSide = SheetSide.end, double? sheetRadius, String sheetBelow = '', double maxHeightFactor = 1, List<double> snapHeights = const [], String stopVariable = '', bool cover = false, double enterScale = 1, int closeAfterMs = 0, RouteTransition? routeTransition, bool enabled = true, bool nonBlocking = false, Predicate? when}) -
const
Properties
-
alignment
→ List<
double> -
A dialog's alignment in the screen,
[x, y](-1 to 1).final - anchor → ModalAnchor
-
final
- anchorGap → double
-
final
- anchorItem → String
-
With ModalAnchor.node, for a node a list repeats: the item whose copy
it sits by (its
idorkey, or its index), asScrollToAction.item. Empty: the node's only (or first) copy.final - anchorNode → String
-
With ModalAnchor.node: the node the popover sits by (its id; an
expression may name it).
final
- anchorOffset → double
-
final
- anchorReserve → double
-
Room a popover keeps below its top: when its top plus this would pass
the screen's bottom margin, it moves up so this much fits (a menu that
may grow keeps its place). 0: placed by its own height.
final
- barrierBlur → double
-
final
- barrierColor → Color?
-
Null: the default scrim (
#8A000000).final - barrierDismissible → bool
-
final
- closeAfterMs → int
-
Closes itself, with no result, this many ms after it has come in; the
clock holds while it is pressed or dragged and runs on when let go (a
banner shown as a toast). 0: it stays until something closes it.
final
- cover → bool
-
A dialog that covers the screen (inside insets): its screen fills it
and is laid out at that size, so its breakpoint and responsive layouts
follow the device, as a screen navigated to does. Not a page route:
the screen behind stays visible through a transparent design.
final
- enabled → bool
-
False skips the action.
finalinherited
- enterScale → double
-
How large it starts (0–1): a dialog grows from it about its middle, an
anchored popover about the middle of the node that opened it (a menu
that grows out of its button). 1: as the presentation comes.
final
- fieldsJson → Json
-
Its own fields, as JSON (sparse): what toJson writes besides
typeand the common fields. An action class outside this library overrides this.no setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- hoverCard → bool
-
An interactive, pass-through preview that can outlive the trigger hover.
final
- hoverDelayMs → int
-
Delay before a hover-triggered preview; zero for touch activation.
final
-
insets
→ List<
double> -
Space kept around a dialog: left, top, right, bottom.
final
- maxHeightFactor → double
-
final
-
nested
→ List<
ActionDef> -
The actions it runs itself (branches, follow-ups), in order.
no setterinherited
- nonBlocking → bool
-
The chain doesn't wait for it, and its failure doesn't stop the chain.
finalinherited
- params → Json
-
final
- placement → PopoverPlacement
-
final
- popoverArrow → bool
-
Draws a pointer from an anchored popover toward its trigger.
final
- presentation → ModalPresentation
-
final
- routeTransition → RouteTransition?
-
A custom transition for the modal: its entrance, what the screen
behind does, its barrier color (over barrierColor) and a drag that
dismisses it. Null opens it the way presentation says.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selfAndNested
→ Iterable<
ActionDef> -
This action, then every action nested in it, depth first.
no setterinherited
- sheetBelow → String
-
ModalPresentation.adaptive: a bottom sheet on screens whose
breakpoint is narrower than this one (a project Breakpoint.id,
DESIGN.md §5.3), a dialog from it up. Empty (or a breakpoint the
project no longer has): the project's second breakpoint, i.e. a sheet
on the narrowest breakpoint only (a dialog everywhere when the project
has one breakpoint). See sheetBelowWidthIn.
final
- sheetRadius → double?
-
A bottom sheet's top corner radius: the sheet clips the screen to it,
so a screen with a solid canvas fill gets rounded top corners. Null:
the platform's default sheet.
final
- sheetSide → SheetSide
-
The side of the screen a ModalPresentation.sideSheet is on and
slides in from, in reading order: SheetSide.end (the right in
left-to-right text; an inspector, a cart) or SheetSide.start (a
navigation drawer). JSON:
"sheetSide": "start".final - sheetWidth → double?
-
final
- showDragHandle → bool
-
final
-
snapHeights
→ List<
double> -
Optional bottom sheet stops as fractions of available screen height.
final
- stopVariable → String
-
A variable's name: the stop of snapHeights the open sheet rests at,
read and written. It holds the stop as it is written in snapHeights
(
0.5,1). The sheet writes it when it opens and whenever the person moves it to another stop (a drag, the handle, the keyboard); setting the variable while the sheet is open moves the sheet to the nearest stop. A sheet opened while the variable holds one of its stops opens there, else at its lowest. When the sheet closes the variable is set to0: no stop. Empty: none.final - to → String
-
final
- type → String
-
The JSON
type.no setteroverride - when → Predicate?
-
Runs only when it holds; null: always.
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sheetBelowWidthIn(
Breakpoints breakpoints) → double -
The screen width below which ModalPresentation.adaptive is a bottom
sheet, by the project's
breakpoints: sheetBelow's min width. -
toJson(
) → Json -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited