PopupMenuThemeData class
Defines the visual properties of the routes used to display popup menus as well as PopupMenuItem and PopupMenuDivider widgets.
Descendant widgets obtain the current PopupMenuThemeData object
using PopupMenuTheme.of(context)
. Instances of
PopupMenuThemeData can be customized with
PopupMenuThemeData.copyWith.
Typically, a PopupMenuThemeData is specified as part of the overall Theme with ThemeData.popupMenuTheme. Otherwise, PopupMenuTheme can be used to configure its own widget subtree.
All PopupMenuThemeData properties are null
by default.
If any of these properties are null, the popup menu will provide its
own defaults.
See also:
- ThemeData, which describes the overall theme information for the application.
- Mixed-in types
- Annotations
Constructors
-
PopupMenuThemeData({Color? color, ShapeBorder? shape, double? elevation, Color? shadowColor, Color? surfaceTintColor, TextStyle? textStyle, MaterialStateProperty<
TextStyle?> ? labelTextStyle, bool? enableFeedback, MaterialStateProperty<MouseCursor?> ? mouseCursor, PopupMenuPosition? position, Color? iconColor, double? iconSize}) -
Creates the set of properties used to configure PopupMenuTheme.
const
Properties
- color → Color?
-
The background color of the popup menu.
final
- elevation → double?
-
The elevation of the popup menu.
final
- enableFeedback → bool?
-
If specified, defines the feedback property for PopupMenuButton.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- iconColor → Color?
-
The color of the icon in the popup menu button.
final
- iconSize → double?
-
The size of the icon in the popup menu button.
final
-
labelTextStyle
→ MaterialStateProperty<
TextStyle?> ? -
You can use this to specify a different style of the label
when the popup menu item is enabled and disabled.
final
-
If specified, the padding of the popup menu.
final
-
mouseCursor
→ MaterialStateProperty<
MouseCursor?> ? -
The cursor for a mouse pointer when it enters or is hovering over the
widget.
final
- position → PopupMenuPosition?
-
Whether the popup menu is positioned over or under the popup menu button.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shadowColor → Color?
-
The color used to paint shadow below the popup menu.
final
- shape → ShapeBorder?
-
The shape of the popup menu.
final
- surfaceTintColor → Color?
-
The color used as an overlay on color of the popup menu.
final
- textStyle → TextStyle?
-
The text style of items in the popup menu.
final
Methods
-
copyWith(
{Color? color, ShapeBorder? shape, double? elevation, Color? shadowColor, Color? surfaceTintColor, TextStyle? textStyle, MaterialStateProperty< TextStyle?> ? labelTextStyle, bool? enableFeedback, MaterialStateProperty<MouseCursor?> ? mouseCursor, PopupMenuPosition? position, Color? iconColor, double? iconSize}) → PopupMenuThemeData - Creates a copy of this object with the given fields replaced with the new values.
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringShort(
) → String -
A brief description of this object, usually just the runtimeType and the
hashCode.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
lerp(
PopupMenuThemeData? a, PopupMenuThemeData? b, double t) → PopupMenuThemeData? - Linearly interpolate between two popup menu themes.