Skip to content
On this page

Menu

An anchored action menu with grouped items and nested choices.

Menu in FluttyUIMenu in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

Usage

ui.Menu(
  trigger: const Text('Actions'),
  items: const [
    ui.MenuItem(label: 'Edit', value: 'edit'),
    ui.MenuItem(label: 'Duplicate', value: 'duplicate'),
  ],
  onSelected: (value) {},
)

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

const Menu({
  super.key,
  this.motion,
  this.controller,
  this.openOnTap = true,
  this.isCompact = false,
  this.size,
  this.openHaptic = HapticType.none,
  required this.trigger,
  required this.items,
  this.onSelected,
  this.width = 280,
  this.backgroundColor,
  this.foregroundColor,
  this.borderColor,
  this.borderRadius,
  this.padding,
  this.itemPadding,
  this.closeOnSelect = true,
  this.alignment = CollisionAlignment.center,
});
ParameterTypeRequiredDefault
keyKey?Nonull
motionComponentMotion?Nonull
controllerMenuController?Nonull
openOnTapboolNotrue
isCompactboolNofalse
sizeComponentSize?Nonull
openHapticHapticTypeNoHapticType.none
triggerWidgetYes—
itemsList<MenuItem>Yes—
onSelectedValueChanged<String>?Nonull
widthdoubleNo280
backgroundColorColor?Nonull
foregroundColorColor?Nonull
borderColorColor?Nonull
borderRadiusdouble?Nonull
paddingEdgeInsetsGeometry?Nonull
itemPaddingEdgeInsetsGeometry?Nonull
closeOnSelectboolNotrue
alignmentCollisionAlignmentNoCollisionAlignment.center

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/collections/menu/menu.dart

This reference is generated from the Menu declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI