Skip to content

Overlays & Feedback

MiuixDismissScope

An InheritedWidget that exposes a dismiss request to dialog content. Wrapped around MiuixOverlayDialog content; descendants can obtain the host dialog's dismiss callback via MiuixDismissScope.maybeOf(context), returning null when not inside a dialog.

ParamTypeDefaultDescription
onDismissRequestVoidCallbackrequiredDismiss request callback
childWidgetrequiredSubtree

Static method:

  • MiuixDismissScope.maybeOf(BuildContext context) → VoidCallback?: Returns the dismiss callback of the nearest ancestor MiuixDismissScope.

MiuixOverlayDialog

A Miuix dialog inside a Scaffold, reproducing large/small-screen layout, scrim, tap-outside dismiss and enter/exit transitions.

ParamTypeDefaultDescription
showboolrequiredWhether the dialog is shown
titleString?nullTitle text
titleColorColor?nullTitle color, defaults to theme onBackground
summaryString?nullSummary text below the title
summaryColorColor?nullSummary color, defaults to theme onSurfaceSecondary
backgroundColorColor?nullBackground color, defaults to theme background
enableWindowDimbooltrueWhether to dim the scrim
onDismissRequestVoidCallback?nullDismiss request callback (tap outside/scrim)
onDismissFinishedVoidCallback?nullCalled when exit animation finishes
outsideMarginSizeSize(12, 12)Outer margin
insideMarginSizeSize(24, 24)Inner margin
defaultWindowInsetsPaddingbooltrueApply system safe-area padding
renderInRootScaffoldbooltrueRender into root Scaffold overlay
maxWidthdouble420Max panel width
largeScreenbool?nullCenter as large screen; auto-detected when null
cornerRadiusdouble?nullCorner radius; defaults to 32 when null
contentWidgetrequiredDialog content

Example:

dart
MiuixOverlayDialog(
  show: show,
  title: 'Notice',
  summary: 'Continue?',
  onDismissRequest: () => setState(() => show = false),
  content: const SizedBox(),
)

MiuixDialogDefaults

Defaults for Miuix dialogs (private constructor, static fields only).

ConstantValueDescription
maxWidth420Max panel width
cornerRadius32Corner radius in large-screen mode
outsideMarginSize(12, 12)Outer margin
insideMarginSize(24, 24)Inner margin
Static methodReturnsDescription
titleColor(context)ColorTitle color, theme onBackground
summaryColor(context)ColorSummary color, theme onSurfaceSecondary
backgroundColor(context)ColorBackground color, theme background

MiuixOverlayBottomSheet

A bottom sheet inside a Scaffold, with a drag handle, spring translation and vertical swipe-to-dismiss. MiuixWindowBottomSheet is the window-level variant (renders into the root Overlay, no renderInRootScaffold param).

ParamTypeDefaultDescription
showboolrequiredWhether the sheet is shown
titleString?nullTitle text
startActionWidget?nullLeading action in the title row
endActionWidget?nullTrailing action in the title row
backgroundColorColor?nullBackground color, defaults to theme background
enableWindowDimbooltrueWhether to dim the scrim
cornerRadiusdouble28Top corner radius
sheetMaxWidthdouble640Max sheet width
onDismissRequestVoidCallback?nullDismiss request callback
onDismissFinishedVoidCallback?nullCalled when exit animation finishes
outsideMarginSizeSize.zeroOuter margin
insideMarginSizeSize(24, 0)Inner margin
defaultWindowInsetsPaddingbooltrueApply system safe-area padding
dragHandleColorColor?nullDrag handle color
allowDismissbooltrueAllow drag/tap to dismiss
enableNestedScrollbooltrueEnable nested scroll
renderInRootScaffoldbooltrueRender into root Scaffold overlay
contentWidgetrequiredSheet content

Example:

dart
MiuixOverlayBottomSheet(
  show: show,
  title: 'Options',
  onDismissRequest: () => setState(() => show = false),
  content: const SizedBox(height: 200),
)

MiuixBottomSheetDefaults

Defaults for Miuix bottom sheets (private constructor, static fields only).

ConstantValueDescription
cornerRadius28Top corner radius
maxWidth640Max sheet width
outsideMarginSize.zeroOuter margin
insideMarginSize(24, 0)Inner margin
Static methodReturnsDescription
backgroundColor(context)ColorBackground color, theme background
dragHandleColor(context)ColorDrag handle color, theme onSurfaceVariantSummary at 20% alpha

MiuixWindowBottomSheet

A window-level bottom sheet. Flutter has no standalone OS window layer; this widget registers with the root Overlay (renderInRootScaffold forced true). Differs from MiuixOverlayBottomSheet only in that it has no renderInRootScaffold param (forced true); other params are identical.

ParamTypeDefaultDescription
showboolrequiredWhether the sheet is shown
titleString?nullTitle text
startActionWidget?nullLeading action in the title row
endActionWidget?nullTrailing action in the title row
backgroundColorColor?nullBackground color, defaults to theme background
enableWindowDimbooltrueWhether to dim the scrim
cornerRadiusdouble28Top corner radius
sheetMaxWidthdouble640Max sheet width
onDismissRequestVoidCallback?nullDismiss request callback
onDismissFinishedVoidCallback?nullCalled when exit animation finishes
outsideMarginSizeSize.zeroOuter margin
insideMarginSizeSize(24, 0)Inner margin
defaultWindowInsetsPaddingbooltrueApply system safe-area padding
dragHandleColorColor?nullDrag handle color
allowDismissbooltrueAllow drag/tap to dismiss
enableNestedScrollbooltrueEnable nested scroll
contentWidgetrequiredSheet content

Example:

dart
MiuixWindowBottomSheet(
  show: show,
  title: 'Options',
  onDismissRequest: () => setState(() => show = false),
  content: const SizedBox(height: 200),
)

MiuixDropdownItem

A single item in a dropdown / spinner / dropdown menu. When children is non-empty the item becomes a submenu trigger (cascading menu).

ParamTypeDefaultDescription
textStringrequiredItem display text
enabledbooltrueWhether clickable
selectedboolfalseSelected state
onClickVoidCallback?nullTap callback (consumed/ignored by cascade layer when it has children)
iconWidget?nullLeading icon
summaryString?nullSummary below the title
childrenList<MiuixDropdownItem>?nullOptional submenu items

Named constructor MiuixDropdownItem.spinner({icon, title, summary}) is kept for legacy SpinnerEntry compatibility.

MiuixDropdownEntry

A group of dropdown items (one visual group). When enabled is false all items in the group are disabled.

ParamTypeDefaultDescription
itemsList<MiuixDropdownItem>requiredItems shown in the group
enabledbooltrueWhether the group is enabled

MiuixDropdownColors

Colors used by dropdown option rows (legacy alias SpinnerColors). All 7 fields are required.

ParamTypeDefaultDescription
contentColorColorrequiredText color of unselected items
summaryColorColorrequiredSummary text color of unselected items
containerColorColorrequiredBackground color of unselected items
selectedContentColorColorrequiredText color of selected items
selectedSummaryColorColorrequiredSummary text color of selected items
selectedContainerColorColorrequiredBackground color of selected items
selectedIndicatorColorColorrequiredColor of the selected indicator (checkmark)

MiuixDropdownDefaults

Default sizes, paddings and colors for dropdown rows (private constructor, static fields and methods only).

ConstantValueDescription
minHeight56Minimum row height in dialog mode
minWidth200Minimum row width in dialog mode
checkIconSize20Size of the trailing checkmark for selected items
arrowSizeSize(10, 16)Size of the up/down arrows in MiuixDropdownArrowEndAction
chevronSizeSize(10, 16)Size of the trailing chevron for rows with a submenu
iconMinSize26Minimum size of the leading icon cell
maxItemTextWidth216Maximum width of the inner icon/text row in popup mode
insideHorizontalPadding20Horizontal padding per row in popup mode
dialogHorizontalPadding28Horizontal padding per row in dialog mode
firstLastVerticalPadding20Top/bottom padding for the first/last row in popup mode
middleVerticalPadding12Top/bottom padding for middle rows (popup) and all rows (dialog)
iconEndPadding12Spacing between the leading icon and the title text
checkIconStartPadding12Spacing between the title/summary block and the trailing checkmark
Static methodReturnsDescription
dropdownColors(context, {...})MiuixDropdownColorsDefault colors for popup mode (content uses onSurfaceContainer, selected uses primary)
dialogDropdownColors(context, {...})MiuixDropdownColorsDefault colors for dialog mode (selected uses onTertiaryContainer / tertiaryContainer)

MiuixDropdownArrowEndAction

A trailing up/down arrow action icon. Drawn at MiuixDropdownDefaults.arrowSize (10×16), vertically centered, color determined by actionColor. Typically placed at the end of the trigger row to indicate a dropdown can be expanded.

ParamTypeDefaultDescription
actionColorColorrequiredFill color of the arrow

Example:

dart
MiuixBasicComponent(
  title: 'Sort',
  endActions: [
    MiuixDropdownArrowEndAction(actionColor: theme.colors.onSurfaceVariantActions),
  ],
  onClick: () {},
)

MiuixDropdownImpl

The render implementation of a dropdown option row. This widget only handles the presentation and click of a single row; the popup layer, trigger and cascading submenu live in separate files. Commonly used inside a MiuixListPopupColumn to build custom dropdown content.

ParamTypeDefaultDescription
itemMiuixDropdownItemrequiredData of the current option
optionSizeintrequiredTotal number of options
isSelectedboolrequiredWhether selected
indexintrequiredIndex of the current item
onSelectedIndexChangeValueChanged<int>requiredCallback invoked with index when selected
dropdownColorsMiuixDropdownColors?null (default dropdownColors)Row colors
enabledbool?null (defaults to item.enabled)Whether clickable; disabled rows ignore clicks and use the disabled text color
dialogModeboolfalseWhether in dialog mode
hasSubmenuboolfalseWhether this row triggers a submenu; when true, a chevron is shown instead of the checkmark and the accessibility role becomes a button
isFirstbool?null (defaults to index == 0)Whether this is the first row of the entire popup (popup mode gives the first row a larger top padding)
isLastbool?null (defaults to index == optionSize - 1)Whether this is the last row of the entire popup

Named constructor MiuixDropdownImpl.text({required String text, ...}): convenience constructor that builds a MiuixDropdownItem from text and enabled internally.

Example:

dart
MiuixListPopupColumn(children: [
  MiuixDropdownImpl.text(text: 'Copy', isSelected: false, index: 0, optionSize: 2, onSelectedIndexChange: (i) {}),
  MiuixDropdownImpl.text(text: 'Paste', isSelected: false, index: 1, optionSize: 2, onSelectedIndexChange: (i) {}),
])

MiuixOverlayDropdownMenu

A Scaffold dropdown menu triggered by a BasicComponent (single group). Default constructor takes one entry; named constructor .entries takes an entries list (multi-group). MiuixWindowDropdownMenu is the window-level variant (no renderInRootScaffold).

ParamTypeDefaultDescription
entryMiuixDropdownEntryrequiredSingle dropdown group (default constructor)
entriesList<MiuixDropdownEntry>requiredMultiple dropdown groups (.entries constructor)
titleStringrequiredTrigger row title
titleColorMiuixBasicComponentColors?nullTitle color
summaryString?nullTrigger row summary
summaryColorMiuixBasicComponentColors?nullSummary color
dropdownColorsMiuixDropdownColors?nullPopup colors, defaults to MiuixDropdownDefaults.dropdownColors
startActionWidget?nullLeading action in the trigger row
bottomActionWidget?nullBottom action in the trigger row
insideMarginEdgeInsetsGeometryMiuixBasicComponentDefaults.insideMarginTrigger row padding
maxHeightdouble?nullMax popup height
enabledbooltrueWhether enabled
renderInRootScaffoldbooltrueRender into root Scaffold overlay
collapseOnSelectionbool?true (null for .entries)Collapse after selection (inferred from group count when null)
onExpandedChangeValueChanged<bool>?nullExpand/collapse callback

Example:

dart
MiuixOverlayDropdownMenu(
  title: 'Sort by',
  entry: MiuixDropdownEntry(items: [
    MiuixDropdownItem(text: 'Name', selected: true, onClick: () {}),
    MiuixDropdownItem(text: 'Date', onClick: () {}),
  ]),
)

MiuixWindowDropdownMenu

A window-level dropdown menu (single group). Named constructor .entries takes multiple groups. Flutter has no standalone OS window layer; this widget registers with the root Overlay (renderInRootScaffold forced true). Differs from MiuixOverlayDropdownMenu only in that it has no renderInRootScaffold param (forced true); other params are identical.

ParamTypeDefaultDescription
entryMiuixDropdownEntryrequiredSingle dropdown group (default constructor)
entriesList<MiuixDropdownEntry>requiredMultiple dropdown groups (.entries constructor)
titleStringrequiredTrigger row title
titleColorMiuixBasicComponentColors?nullTitle color
summaryString?nullTrigger row summary
summaryColorMiuixBasicComponentColors?nullSummary color
dropdownColorsMiuixDropdownColors?nullPopup colors, defaults to MiuixDropdownDefaults.dropdownColors
startActionWidget?nullLeading action in the trigger row
bottomActionWidget?nullBottom action in the trigger row
insideMarginEdgeInsetsGeometryMiuixBasicComponentDefaults.insideMarginTrigger row padding
maxHeightdouble?nullMax popup height
enabledbooltrueWhether enabled
collapseOnSelectionbool?true (null for .entries)Collapse after selection (inferred from group count when null)
onExpandedChangeValueChanged<bool>?nullExpand/collapse callback

Example:

dart
MiuixWindowDropdownMenu(
  title: 'Sort by',
  entry: MiuixDropdownEntry(items: [
    MiuixDropdownItem(text: 'Name', selected: true, onClick: () {}),
    MiuixDropdownItem(text: 'Date', onClick: () {}),
  ]),
)

MiuixOverlayIconDropdownMenu

A Scaffold icon dropdown menu triggered by an IconButton (single group). Named constructor .entries takes multiple groups; MiuixWindowIconDropdownMenu is the window-level variant.

ParamTypeDefaultDescription
entryMiuixDropdownEntryrequiredSingle dropdown group (default constructor)
entriesList<MiuixDropdownEntry>requiredMultiple dropdown groups (.entries constructor)
enabledbooltrueWhether enabled
maxHeightdouble?nullMax popup height
dropdownColorsMiuixDropdownColors?nullPopup colors
renderInRootScaffoldbooltrueRender into root Scaffold overlay
collapseOnSelectionbool?true (null for .entries)Collapse after selection
onExpandedChangeValueChanged<bool>?nullExpand/collapse callback
backgroundColorColor?nullIcon button background color
cornerRadiusdoubleMiuixIconButtonDefaults.cornerRadiusIcon button corner radius
minHeightdoubleMiuixIconButtonDefaults.minHeightIcon button min height
minWidthdoubleMiuixIconButtonDefaults.minWidthIcon button min width
childWidgetrequiredIcon button content

MiuixWindowIconDropdownMenu

A window-level icon dropdown menu (single group). Named constructor .entries takes multiple groups. Flutter has no standalone OS window layer; this widget registers with the root Overlay (renderInRootScaffold forced true). Differs from MiuixOverlayIconDropdownMenu only in that it has no renderInRootScaffold param (forced true); other params are identical.

ParamTypeDefaultDescription
entryMiuixDropdownEntryrequiredSingle dropdown group (default constructor)
entriesList<MiuixDropdownEntry>requiredMultiple dropdown groups (.entries constructor)
enabledbooltrueWhether enabled
maxHeightdouble?nullMax popup height
dropdownColorsMiuixDropdownColors?nullPopup colors
collapseOnSelectionbool?true (null for .entries)Collapse after selection
onExpandedChangeValueChanged<bool>?nullExpand/collapse callback
backgroundColorColor?nullIcon button background color
cornerRadiusdoubleMiuixIconButtonDefaults.cornerRadiusIcon button corner radius
minHeightdoubleMiuixIconButtonDefaults.minHeightIcon button min height
minWidthdoubleMiuixIconButtonDefaults.minWidthIcon button min width
childWidgetrequiredIcon button content

MiuixOverlayIconCascadingDropdownMenu

A Scaffold icon cascading dropdown menu triggered by an IconButton; a MiuixDropdownItem.children-bearing item becomes a submenu trigger, cascade depth limited to 2. Named constructor .entries takes multiple groups; MiuixWindowIconCascadingDropdownMenu is the window-level variant.

ParamTypeDefaultDescription
entry / entriesMiuixDropdownEntry / List<MiuixDropdownEntry>requiredDropdown groups (default / .entries constructor)
enabledbooltrueWhether enabled
maxHeightdouble?nullMax popup height
dropdownColorsMiuixDropdownColors?nullPopup colors
renderInRootScaffoldbooltrueRender into root Scaffold overlay
collapseOnSelectionbooltrueCollapse after selection
onExpandedChangeValueChanged<bool>?nullExpand/collapse callback
backgroundColorColor?nullIcon button background color
cornerRadiusdoubleMiuixIconButtonDefaults.cornerRadiusIcon button corner radius
minHeightdoubleMiuixIconButtonDefaults.minHeightIcon button min height
minWidthdoubleMiuixIconButtonDefaults.minWidthIcon button min width
childWidgetrequiredIcon button content

MiuixWindowIconCascadingDropdownMenu

A window-level icon cascading dropdown menu (single group). Named constructor .entries takes multiple groups. Flutter has no standalone OS window layer; this widget registers with the window-level Overlay. Differs from MiuixOverlayIconCascadingDropdownMenu only in that it has no renderInRootScaffold param (forced true); other params are identical.

ParamTypeDefaultDescription
entry / entriesMiuixDropdownEntry / List<MiuixDropdownEntry>requiredDropdown groups (default / .entries constructor)
enabledbooltrueWhether enabled
maxHeightdouble?nullMax popup height
dropdownColorsMiuixDropdownColors?nullPopup colors
collapseOnSelectionbooltrueCollapse after selection
onExpandedChangeValueChanged<bool>?nullExpand/collapse callback
backgroundColorColor?nullIcon button background color
cornerRadiusdoubleMiuixIconButtonDefaults.cornerRadiusIcon button corner radius
minHeightdoubleMiuixIconButtonDefaults.minHeightIcon button min height
minWidthdoubleMiuixIconButtonDefaults.minWidthIcon button min width
childWidgetrequiredIcon button content

MiuixDropdownEntriesPopupContent

Renders MiuixDropdownEntry group lists inside a popup container. Computes the popup-global first/last internally: only the very first and very last rows of the whole popup get the larger first/last padding; group boundaries fall back to middle-row padding. A 1.5dp divider is inserted between groups. The caller must place it inside a scrollable container such as MiuixListPopupColumn; this widget itself does not scroll.

ParamTypeDefaultDescription
entriesList<MiuixDropdownEntry>requiredOne or more dropdown groups
dropdownColorsMiuixDropdownColorsrequiredDropdown row colors
onItemClickvoid Function(int entryIdx, int itemIdx)requiredItem click callback with (group index, item index)

MiuixDropdownEntriesDialogItems

Renders MiuixDropdownEntry group lists inside a dialog container (as children of ListView/Column). Dialog mode uses a uniform vertical padding and does not propagate popup-global first/last; a 1.5dp divider is also inserted between groups.

ParamTypeDefaultDescription
entriesList<MiuixDropdownEntry>requiredOne or more dropdown groups
dropdownColorsMiuixDropdownColorsrequiredDropdown row colors
onItemClickvoid Function(int entryIdx, int itemIdx)requiredItem click callback

MiuixOverlayDropdownPopup

A Scaffold-level dropdown popup. Default constructor takes a single entry (single group); named constructor .entries takes an entries list (multi-group). Internally renders via MiuixOverlayListPopup and MiuixDropdownEntriesPopupContent, aligned with MiuixPopupAlign.end. Tapping an item triggers HapticFeedback.selectionClick() and closes based on collapseOnSelection.

ParamTypeDefaultDescription
entryMiuixDropdownEntry?required (default constructor)Single dropdown group
entriesList<MiuixDropdownEntry>required (.entries constructor)Multiple dropdown groups
showboolrequiredWhether to show
anchorBoundsRectrequiredAnchor Rect in window coordinates
onDismissVoidCallbackrequiredDismiss request callback
onDismissFinishedVoidCallbackrequiredExit animation end callback
maxHeightdouble?nullMax popup height
dropdownColorsMiuixDropdownColorsrequiredPopup colors
renderInRootScaffoldbooltrueWhether to register with the root registry
collapseOnSelectionbool?true (default) / entries.length <= 1 (.entries)Collapse after selection

MiuixWindowDropdownPopup

A window-level dropdown popup. Flutter's Navigator Overlay is already a window-level host, so this does not depend on MiuixScaffold and has no renderInRootScaffold param. Otherwise behaves like MiuixOverlayDropdownPopup.

ParamTypeDefaultDescription
entryMiuixDropdownEntry?required (default constructor)Single dropdown group
entriesList<MiuixDropdownEntry>required (.entries constructor)Multiple dropdown groups
showboolrequiredWhether to show
anchorBoundsRectrequiredAnchor Rect
onDismissVoidCallbackrequiredDismiss request callback
onDismissFinishedVoidCallbackrequiredExit animation end callback
maxHeightdouble?nullMax popup height
dropdownColorsMiuixDropdownColorsrequiredPopup colors
collapseOnSelectionbool?true (default) / entries.length <= 1 (.entries)Collapse after selection

MiuixOverlayDropdownDialog

A Scaffold dropdown dialog (single group). Named constructor .entries takes multiple groups; uses MiuixOverlayDialog as the container to render MiuixDropdownEntriesDialogItems, with a title and a bottom confirm button. Tapping an item triggers HapticFeedback.selectionClick() and closes the dialog depending on collapseOnSelection.

ParamTypeDefaultDescription
entryMiuixDropdownEntry?required (default constructor)Single dropdown group
entriesList<MiuixDropdownEntry>required (.entries constructor)Multiple dropdown groups
titleStringrequiredDialog title
dialogButtonStringStringrequiredBottom button text
showboolrequiredWhether to show
onDismissVoidCallbackrequiredDismiss request callback
onDismissFinishedVoidCallbackrequiredExit animation end callback
dropdownColorsMiuixDropdownColorsrequiredDropdown row colors
renderInRootScaffoldbooltrueRender into root Scaffold overlay
collapseOnSelectionbool?true (default) / entries.length <= 1 (.entries)Collapse after selection

MiuixWindowDropdownDialog

A window-level dropdown dialog (single group). Named constructor .entries takes multiple groups. Flutter has no standalone OS window layer; this widget registers with the root Overlay via MiuixOverlayDialog's renderInRootScaffold: true. Differs from MiuixOverlayDropdownDialog only in that it has no renderInRootScaffold param (forced true); other params are identical.

ParamTypeDefaultDescription
entryMiuixDropdownEntry?required (default constructor)Single dropdown group
entriesList<MiuixDropdownEntry>required (.entries constructor)Multiple dropdown groups
titleStringrequiredDialog title
dialogButtonStringStringrequiredBottom button text
showboolrequiredWhether to show
onDismissVoidCallbackrequiredDismiss request callback
onDismissFinishedVoidCallbackrequiredExit animation end callback
dropdownColorsMiuixDropdownColorsrequiredDropdown row colors
collapseOnSelectionbool?true (default) / entries.length <= 1 (.entries)Collapse after selection

MiuixListPopupColumn

A scrollable column that unifies all items to the width of the widest of the first eight items (clamped to 200–288 logical px); one of the ListPopup building blocks, usually given a max-height constraint by the popup host.

ParamTypeDefaultDescription
childrenList<Widget>requiredList items
scrollControllerScrollController?nullScroll controller
physicsScrollPhysics?nullScroll physics, defaults to ClampingScrollPhysics

ListPopup Series

ListPopup is a lightweight popup layer positioned by an anchor Rect, replicating 0.15→1 reveal, fade, dim, tap-outside dismiss and back-key dismiss. Suitable for context menus, right-click menus, custom dropdowns, etc.

MiuixPopupAlign

Logical alignment of the popup relative to the anchor. start/end are mirrored automatically under RTL.

ValueDescription
startStart side (left in LTR), vertical position auto-selected above/below the anchor
endEnd side (right in LTR), vertical position auto-selected
topStartBelow the anchor, start-aligned
topEndBelow the anchor, end-aligned
bottomStartAbove the anchor, start-aligned
bottomEndAbove the anchor, end-aligned

MiuixPopupPositionProvider

Position calculation interface for the unified popup host. All coordinates are logical pixels relative to the window's top-left; implementations must not read MediaQuery themselves, so the same algorithm works for both Overlay and window-level hosts.

Method / FieldTypeDescription
calculatePosition({anchorBounds, windowBounds, textDirection, popupContentSize, popupMargin, alignment})OffsetComputes the popup's top-left position in window coordinates
marginsEdgeInsetsGeometryExtra popup margin; directional margins are resolved by the caller against the current text direction

MiuixPopupSpringSpec

Spring specification for popup animations.

ParamTypeDescription
dampingRatiodoubleDamping ratio
stiffnessdoubleStiffness
visibilityThresholddoubleSpring simulation tolerance

The description getter returns a Flutter SpringDescription; simulation(from, to, {velocity}) creates a SpringSimulation for AnimationController.unbounded().animateWith(...).

MiuixPopupTweenSpec

Duration and curve of a popup tween animation.

ParamTypeDescription
durationDurationDuration
curveCurveCurve

MiuixListPopupDefaults

Size, animation and default position strategies for ListPopup (private constructor, static fields only).

Constant / MethodValue / ReturnsDescription
minWidth200Minimum popup width
minPopupHeight50Minimum popup height
cornerRadius16Corner radius
fractionAnimationSpecspring(0.82, 362.5)Reveal animation spring
resetAnimationSpecsame as aboveReset animation spring
alphaEnterAnimationSpec200ms / fastOutSlowInEnter fade
alphaExitAnimationSpec150ms / fastOutSlowInExit fade
dimEnterAnimationSpec300ms / sinOutDim enter
dimExitAnimationSpec150ms / sinOutDim exit
dropdownPositionMiuixPopupPositionProviderDefault dropdown position strategy (verticalMargin=8)
contextMenuPositionMiuixPopupPositionProviderDefault context-menu position strategy (no margin)
dropdownPositionProvider({verticalMargin, horizontalMargin})MiuixPopupPositionProviderCreates a custom dropdown position strategy

MiuixListPopupColumn

A scrollable column that unifies all items to the width of the widest of the first eight items (clamped to 200–288 logical px); one of the ListPopup building blocks, usually given a max-height constraint by the popup host.

ParamTypeDefaultDescription
childrenList<Widget>requiredList items
scrollControllerScrollController?nullScroll controller
physicsScrollPhysics?nullScroll physics, defaults to ClampingScrollPhysics

MiuixListPopupContent

A container that carries the list content with scale, fade and directional squircle reveal. Usually consumed internally by the popup host; callers rarely construct it directly.

ParamTypeDefaultDescription
popupContentSizeSizerequiredCurrent content size (Size.zero on first build)
onPopupContentSizeChangeValueChanged<Size>requiredContent size change callback
fractionProgressdouble Function()requiredLive reader for reveal progress (0..1)
alphaProgressdouble Function()requiredLive reader for alpha progress (0..1)
popupLayoutPositionMiuixPopupLayoutPositionrequiredLayout position info
localTransformOriginOffsetrequiredLocal transform origin (normalized)
childWidgetrequiredList content (usually MiuixListPopupColumn)
animationListenable?nullMerged animation listenable to avoid widget rebuilds
backgroundColorColor?nullBackground color, defaults to colors.surfaceContainer
cornerRadiusdoubleMiuixListPopupDefaults.cornerRadius (16)Corner radius

MiuixOverlayListPopup

A Scaffold-level list popup. Registers with the root or local registry via MiuixPopupLayout and is drawn by the unified popup host.

ParamTypeDefaultDescription
showboolrequiredWhether to show
anchorBoundsRectrequiredAnchor Rect in window coordinates
popupPositionProviderMiuixPopupPositionProvider?null (defaults to dropdownPosition)Position strategy
alignmentMiuixPopupAlignstartAlignment
enableWindowDimbooltrueWhether to enable dim
onDismissRequestVoidCallback?nullDismiss request callback
onDismissFinishedVoidCallback?nullExit animation end callback
maxHeightdouble?nullMax height
minWidthdoubleMiuixListPopupDefaults.minWidth (200)Min width
renderInRootScaffoldbooltrueWhether to register with the root registry
contentWidgetrequiredPopup content

Example:

dart
MiuixOverlayListPopup(
  show: show,
  anchorBounds: anchorRect,
  onDismissRequest: () => setState(() => show = false),
  content: MiuixListPopupColumn(children: [
    MiuixDropdownImpl.text(text: 'Copy', isSelected: false, index: 0,
      optionSize: 2, onSelectedIndexChange: (i) {}),
  ]),
)

MiuixWindowListPopup

A window-level list popup. Flutter's Navigator Overlay is already a window-level host, so this does not depend on MiuixScaffold. Same params as MiuixOverlayListPopup but without renderInRootScaffold.

MiuixOverlayCascadingListPopup

A Scaffold-level two-level cascading list popup. When a MiuixDropdownItem.children is non-empty it becomes a submenu trigger; cascade depth is limited to 2. The main menu reuses ListPopup animations; the submenu uses 0.95 main-layer scale, half-strength dim and a spring expand to reproduce the cascade state.

ParamTypeDefaultDescription
showboolrequiredWhether to show
anchorBoundsRectrequiredAnchor Rect
entriesList<MiuixDropdownEntry>requiredMulti-group data (including submenu items)
onDismissRequestVoidCallbackrequiredDismiss request callback
onDismissFinishedVoidCallback?nullExit animation end callback
popupPositionProviderMiuixPopupPositionProvider?null (defaults to dropdownPosition)Position strategy
alignmentMiuixPopupAlignendAlignment
enableWindowDimbooltrueWhether to enable dim
maxHeightdouble?nullMax height
minWidthdouble200Min width
renderInRootScaffoldbooltrueWhether to register with root
dropdownColorsMiuixDropdownColors?nullColors, defaults to dropdownColors
collapseOnSelectionbooltrueWhether to collapse after selection

MiuixWindowCascadingListPopup

A window-level two-level cascading list popup. Same params as above, without renderInRootScaffold.

MiuixPopupLayoutPosition

Which side of the anchor the popup sits on, and which horizontal edge it hugs.

FieldTypeDescription
showBelowboolWhether shown below the anchor
showAboveboolWhether shown above the anchor
isRightAlignedboolWhether right-aligned
showMiddlebool (getter)Neither above nor below (vertically overlaps the anchor)

MiuixListPopupLayoutInfo

Full layout info needed by the popup host for positioning, scaling and reveal animation. Usually computed via computeListPopupLayoutInfo and passed into the host.

FieldTypeDescription
windowBoundsRectWindow safe-area bounds
popupMarginEdgeInsetsResolved popup margin
calculatedOffsetOffsetPopup top-left in window coordinates; Offset.zero until content is measured
effectiveTransformOriginOffsetNormalized window-coordinate origin for the unified host's global animations
localTransformOriginOffsetNormalized popup-local origin for MiuixListPopupContent
popupLayoutPositionMiuixPopupLayoutPositionLayout position info

computeListPopupLayoutInfo(context, {alignment, popupPositionProvider, parentBounds, popupContentSize})MiuixListPopupLayoutInfo

Computes the layout info needed by the popup host from the window safe area, anchor and measured content. parentBounds must be in window coordinates; pass Size.zero on first build — a predicted origin is returned, then re-computed once MiuixListPopupContent.onPopupContentSizeChange reports back.

safeTransformOrigin(x, y)Offset

Zeroes out NaN and negative values in a transform origin; positive values (including >1) are preserved.

MiuixTooltipAnchorPosition

Enum of preferred tooltip positions relative to the anchor. Automatically flips to the opposite side when space is short; start/end are first resolved to left/right under RTL.

ValueDescription
aboveAbove the anchor
belowBelow the anchor
leftTo the left of the anchor
rightTo the right of the anchor
startStart side (left in LTR, right in RTL)
endEnd side (right in LTR, left in RTL)

MiuixTooltipState

Visibility state controller for tooltips, extending ChangeNotifier. All instances share a single active slot, so at most one tooltip is visible at a time; non-persistent states auto-close after MiuixTooltipDefaults.tooltipDuration (1500ms).

ParamTypeDefaultDescription
initialIsVisibleboolfalseInitial visibility
isPersistentboolfalseWhether the tooltip is persistent (no auto-close)
Method / FieldReturnsDescription
isVisiblebool (getter)Current visibility
show()Future<void>Shows the tooltip; the returned Future completes when closed
dismiss()voidDismisses the tooltip

MiuixTooltipScope

Anchor info available when building tooltip content.

FieldTypeDescription
positioningMiuixTooltipAnchorPositionResolved position (after RTL resolution and short-space flip)
anchorBoundsRectAnchor bounds in Overlay coordinates

MiuixRichTooltipColors

Color configuration for rich tooltips. All 4 fields are required.

ParamTypeDefaultDescription
containerColorColorrequiredContainer background color
contentColorColorrequiredBody content color
titleContentColorColorrequiredTitle content color
actionContentColorColorrequiredAction button content color

MiuixTooltipDefaults

Default sizes, colors and animation durations for tooltips (private constructor, static fields only).

ConstantValueDescription
spacingBetweenTooltipAndAnchor8Gap between tooltip and anchor
caretSizeSize(16, 8)Caret size
plainTooltipMaxWidth200Plain tooltip max width
plainTooltipCornerRadius12Plain tooltip corner radius
plainTooltipInsideMarginEdgeInsets.symmetric(horizontal: 12, vertical: 8)Plain tooltip inner padding
richTooltipMaxWidth320Rich tooltip max width
richTooltipCornerRadius16Rich tooltip corner radius
richTooltipInsideMarginEdgeInsets.all(16)Rich tooltip inner padding
richTooltipActionCornerRadius8Rich tooltip action button corner radius
richTooltipActionInsideMarginEdgeInsets.symmetric(horizontal: 12, vertical: 6)Rich tooltip action button inner padding
tooltipDurationDuration(milliseconds: 1500)Auto-close duration for non-persistent tooltips
animationDurationDuration(milliseconds: 180)Enter/exit animation duration
Static methodReturnsDescription
plainTooltipContainerColor(context)ColorPlain tooltip container color, onSecondaryVariant
plainTooltipContentColor(context)ColorPlain tooltip content color, secondaryVariant
richTooltipColors(context)MiuixRichTooltipColorsDefault rich tooltip colors

MiuixTooltipBox

Anchors tooltip to child, supporting mouse hover, touch long-press and state control.

ParamTypeDefaultDescription
tooltipWidget Function(BuildContext, MiuixTooltipScope)requiredTooltip content slot; scope provides resolved position and anchor bounds
childWidgetrequiredAnchor child
stateMiuixTooltipState?nullVisibility state, created internally when omitted
positioningMiuixTooltipAnchorPositionbelowPreferred position, flips when space is short
spacingdouble8Gap between tooltip and anchor
focusableboolfalseDismiss on tap-outside/back
enableUserInputbooltrueRespond to hover/long-press
semanticLabelString'显示提示'Accessibility label

Example:

dart
MiuixTooltipBox(
  tooltip: (context, scope) =>
      MiuixPlainTooltip(scope: scope, child: const Text('Tooltip text')),
  child: MiuixIcon(vector: MiuixIcons.extended.byName('info')!),
)

MiuixPlainTooltip

A short-label tooltip on an inverse surface, used with MiuixTooltipBox.

ParamTypeDefaultDescription
scopeMiuixTooltipScoperequiredAnchor info from MiuixTooltipBox
childWidgetrequiredTooltip content
showCaretboolfalseShow caret pointing at the anchor
maxWidthdouble200Max width
cornerRadiusdouble12Corner radius
containerColorColor?nullBackground color, defaults to inverse surface
contentColorColor?nullContent color
insideMarginEdgeInsetsGeometryEdgeInsets.symmetric(horizontal: 12, vertical: 8)Inner padding

MiuixRichTooltip

A persistent rich tooltip with optional title and action, used with MiuixTooltipBox.

ParamTypeDefaultDescription
scopeMiuixTooltipScoperequiredAnchor info from MiuixTooltipBox
textWidgetrequiredBody content
titleWidget?nullTitle
actionWidget?nullAction button
showCaretboolfalseShow caret
maxWidthdouble320Max width
cornerRadiusdouble16Corner radius
colorsMiuixRichTooltipColors?nullColors, defaults to theme
insideMarginEdgeInsetsGeometryEdgeInsets.all(16)Inner padding

MiuixRichTooltipBox

A convenience wrapper for rich tooltips; creates a persistent state by default and supports tap-outside/back dismiss. Takes title/body/action as strings, so no tooltip slot is needed.

ParamTypeDefaultDescription
textStringrequiredBody text
childWidgetrequiredAnchor child
stateMiuixTooltipState?nullVisibility state, defaults to an internally created persistent state
titleString?nullTitle text
actionTextString?nullAction button text
onActionPressedVoidCallback?nullAction button callback
enabledbooltrueRespond to user input
positioningMiuixTooltipAnchorPositionbelowPreferred position
colorsMiuixRichTooltipColors?nullColors
showCaretboolfalseShow caret

MiuixSnackbarVisuals

Visual data of a snackbar.

ParamTypeDefaultDescription
messageStringrequiredMessage text to display
actionLabelString?nullOptional action label
withDismissActionboolfalseWhether to show a dismiss action
durationMiuixSnackbarDurationMiuixSnackbarDuration.shortDisplay duration

MiuixSnackbarData

Interaction data interface for snackbars.

Method / FieldTypeDescription
visualsMiuixSnackbarVisuals (getter)Visual data of the snackbar
dismiss()Future<void>Dismisses the snackbar
performAction()Future<void>Performs the snackbar action

MiuixSnackbarResult

Result enum for snackbar completion.

ValueDescription
dismissedThe snackbar was dismissed or timed out
actionPerformedThe user performed the snackbar action

MiuixSnackbarColors

Color configuration for snackbar cards. All 5 fields are required.

ParamTypeDefaultDescription
containerColorColorrequiredCard background color
contentColorColorrequiredMessage content color
actionContentColorColorrequiredAction label content color
dismissActionContentColorColorrequiredDismiss action content color
actionContainerColorColorrequiredAction label capsule background color

MiuixSnackbarDefaults

Defaults for snackbars (private constructor, static fields only).

ConstantValueDescription
cornerRadius16Default corner radius
insideMarginEdgeInsets.all(12)Default inner padding
outerPaddingEdgeInsets.only(left: 12, right: 12, top: 8)Default outer padding
actionCornerRadius50Default action label capsule corner radius
actionInsideMarginEdgeInsets.symmetric(horizontal: 12)Default action label capsule inner padding
Static methodReturnsDescription
snackbarColors(context)MiuixSnackbarColorsCreates default snackbar colors from the current theme

MiuixSnackbarHostState

State object for the Snackbar Host, extending ChangeNotifier. Holds the snackbar queue; each showSnackbar adds an independent snackbar at the bottom of the queue, so multiple messages can be visible at once. The returned Future completes on timeout, dismiss, swipe-dismiss or action performed.

MethodReturnsDescription
showSnackbar(message, {actionLabel, withDismissAction, duration})Future<MiuixSnackbarResult>Enqueues a snackbar and returns its completion result
newestSnackbarData()Future<MiuixSnackbarData?>Returns the newest visible snackbar data
oldestSnackbarData()Future<MiuixSnackbarData?>Returns the oldest visible snackbar data

Example:

dart
final host = MiuixSnackbarHostState();
host.showSnackbar('Saved', actionLabel: 'Undo');
MiuixSnackbarHost(state: host);

MiuixSnackbarHost

Manages the snackbar queue, auto-dismiss, enter/exit and bidirectional swipe-to-dismiss; the newest message sits at the bottom.

ParamTypeDefaultDescription
stateMiuixSnackbarHostStaterequiredHost state
canSwipeToDismissbooltrueAllow horizontal swipe to dismiss
builderWidget Function(BuildContext, MiuixSnackbarData)?nullCustom card content, defaults to building MiuixSnackbar
blurSigmadouble0.0Blur sigma passed to the default MiuixSnackbar; > 0 enables frosted-glass background
blurBackgroundAlphadouble0.55Background opacity passed to the default MiuixSnackbar when blur is enabled

MiuixSnackbarHostState enqueues via showSnackbar(message, {actionLabel, withDismissAction, duration}), returning a Future<MiuixSnackbarResult>.

Example:

dart
final host = MiuixSnackbarHostState();
// show
host.showSnackbar('Saved', actionLabel: 'Undo');
// mount (frosted-glass background)
MiuixSnackbarHost(state: host, blurSigma: 30);

MiuixSnackbar

The snackbar card built by the host by default; can be used directly inside a custom builder.

ParamTypeDefaultDescription
dataMiuixSnackbarDatarequiredSnackbar interaction data
cornerRadiusdouble16Card corner radius
colorsMiuixSnackbarColors?nullCard colors, defaults to theme
insideMarginEdgeInsetsGeometryEdgeInsets.all(12)Card inner padding
blurSigmadouble0.0Gaussian blur sigma; > 0 enables HyperOS-style frosted-glass background (blurs content behind via BackdropFilter, container color becomes semi-transparent)
blurBackgroundAlphadouble0.55Container opacity when blur is enabled; lower = more transparent

MiuixFloatingToolbar

A floating toolbar: a self-contained container (squircle background + fixed-geometry shadow + optional stroke). Row/column orientation is decided by the caller inside child.

ParamTypeDefaultDescription
childWidgetrequiredContent (caller arranges with Row/Column)
colorColor?nullBackground color, defaults to theme surfaceContainer
cornerRadiusdouble50Corner radius
outSidePaddingEdgeInsetsGeometryEdgeInsets.symmetric(horizontal: 12, vertical: 8)Outer padding
shadowElevationdouble4Shadow toggle (>0 shows; geometry fixed, not scaled)
showDividerboolfalseShow a 0.75dp stroke

Example:

dart
MiuixFloatingToolbar(
  child: Row(mainAxisSize: MainAxisSize.min, children: const [/* buttons */]),
)

MiuixFloatingToolbarDefaults

Defaults for floating toolbars (private constructor, static fields only).

ConstantValueDescription
cornerRadius50Default corner radius (forms a capsule outline with short toolbar heights)
outSidePaddingEdgeInsets.symmetric(horizontal: 12, vertical: 8)Toolbar outer padding
Static methodReturnsDescription
defaultColor(context)ColorDefault background color, theme surfaceContainer

MiuixProgressIndicatorColors

Color configuration for progress indicators. All 3 fields are required.

ParamTypeDefaultDescription
foregroundColorColorrequiredForeground color when enabled
disabledForegroundColorColorrequiredForeground color when disabled
backgroundColorColorrequiredTrack background color
MethodReturnsDescription
foreground(bool enabled)ColorReturns the foreground color based on enabled
background()ColorReturns the track background color

MiuixProgressIndicatorDefaults

Defaults for progress indicators (private constructor, static fields only).

ConstantValueDescription
defaultLinearHeight6Default linear indicator height
defaultCircularStrokeWidth4Default circular indicator stroke width
defaultCircularSize30Default circular indicator size
defaultInfiniteStrokeWidth2Default infinite indicator track ring width
defaultInfiniteOrbitingDotSize2Default infinite indicator orbiting dot size
defaultInfiniteSize20Default infinite indicator size
Static methodReturnsDescription
defaultColors(context)MiuixProgressIndicatorColorsDefault colors for linear and circular progress indicators

MiuixLinearProgressIndicator

A Miuix-style linear progress indicator. When progress is null it shows a 1250ms linear looping animation.

ParamTypeDefaultDescription
progressdouble?nullProgress (0–1); null for infinite loop
colorsMiuixProgressIndicatorColors?nullColors, defaults to theme
heightdouble6Track height

MiuixCircularProgressIndicator

A Miuix-style circular progress indicator. When progress is null the arc rotates and sweeps between 30° and 120°.

ParamTypeDefaultDescription
progressdouble?nullProgress (0–1); null for infinite loop
colorsMiuixProgressIndicatorColors?nullColors, defaults to theme
strokeWidthdouble4Arc stroke width
sizedouble30Indicator size

MiuixInfiniteProgressIndicator

An infinite progress indicator with a track ring and an orbiting dot.

ParamTypeDefaultDescription
colorColorColor(0xFF888888)Color
sizedouble20Indicator size
strokeWidthdouble2Track ring width
orbitingDotSizedouble2Orbiting dot size

Example:

dart
const MiuixCircularProgressIndicator()          // infinite loop
const MiuixLinearProgressIndicator(progress: 0.6)

MiuixRefreshState

Enum of visual states for the pull-to-refresh indicator.

ValueDescription
idleIdle
pullingPulling, threshold not yet reached
thresholdReachedRefresh threshold reached
refreshingRefreshing
refreshCompleteRefresh complete (fade-out transition)

MiuixPullToRefreshDefaults

Defaults for pull-to-refresh (private constructor, static fields only).

ConstantValueDescription
colorColor(0xFF888888)Indicator color
circleSize20Indicator circle size
refreshThreshold0.25Refresh trigger progress threshold (0–1)
refreshTexts['Pull down to refresh', 'Release to refresh', 'Refreshing...', 'Refreshed successfully']Per-state hint texts
refreshTextStyleTextStyle(fontSize: 14, fontWeight: bold, color: color)Hint text style

MiuixPullToRefreshController

Pull-to-refresh controller, extending ChangeNotifier. Holds the pull distance, progress and refresh visual state. refreshThreshold is the fraction of the full damped drag range that triggers a refresh, clamped to 0–1; the refresh business state is still hoisted by MiuixPullToRefresh.isRefreshing.

ParamTypeDefaultDescription
refreshThresholddoubleMiuixPullToRefreshDefaults.refreshThreshold (0.25)Trigger threshold, range 0–1
Method / FieldTypeDescription
refreshStateMiuixRefreshState (getter)Current refresh visual state
dragOffsetdouble (getter)Current damped pull distance (logical pixels)
pullProgressdouble (getter)Progress relative to the effective threshold
fullDragProgressdouble (getter)Progress relative to the full damped drag range
visualProgressdouble (getter)Indicator scale progress from zero to full size
refreshThresholddouble (getter/setter)Trigger threshold; setter recomputes internal parameters

MiuixPullToRefresh

A Miuix-style pull-to-refresh container. child should contain a vertical scrollable; the refresh state is hoisted by the caller via isRefreshing.

ParamTypeDefaultDescription
isRefreshingboolrequiredRefresh state hoisted by the caller
onRefreshVoidCallbackrequiredCalled after releasing past the threshold; set isRefreshing to true ASAP
childWidgetrequiredContent (containing a vertical scrollable)
controllerMiuixPullToRefreshController?nullPull state controller, created internally when omitted
contentPaddingEdgeInsetsGeometryEdgeInsets.zeroContent padding
topAppBarScrollBehaviorMiuixScrollBehavior?nullScroll behavior linked to the top app bar
colorColorColor(0xFF888888)Indicator color
circleSizedouble20Indicator circle size
refreshTextsList<String>MiuixPullToRefreshDefaults.refreshTextsPer-state hint texts
refreshTextStyleTextStyleMiuixPullToRefreshDefaults.refreshTextStyleHint text style
onPullProgressValueChanged<double>?nullLive progress over the full damped drag range

Example:

dart
MiuixPullToRefresh(
  isRefreshing: refreshing,
  onRefresh: () => setState(() => refreshing = true),
  child: ListView(physics: const AlwaysScrollableScrollPhysics(), children: const []),
)

Released under the Apache-2.0 License.