BubbleMenuConfiguration class
Context-menu settings for message bubbles.
Sender and receiver menus are configured separately, so each side can offer different entries (e.g. "Delete" only on your own messages).
The menu opens on a long press — a held touch, or a held mouse button on desktop and web. Right click is deliberately not a trigger: on the web it would open the browser's own context menu at the same time.
A side without an items builder and without a handler has no menu.
Constructors
- BubbleMenuConfiguration({BubbleMenuItemsBuilder? senderItemsBuilder, BubbleMenuItemsBuilder? receiverItemsBuilder, BubbleMenuHandler? senderMenuHandler, BubbleMenuHandler? receiverMenuHandler, bool enableLongPress = true, bool enableHapticFeedback = true, Color? color, Color? surfaceTintColor, ShapeBorder? shape, double? elevation, BoxConstraints? constraints, AnimationStyle? animationStyle, })
-
Creates a BubbleMenuConfiguration.
const
Properties
- animationStyle → AnimationStyle?
-
Duration and curve of the default menu's open/close transition.
final
- color → Color?
-
Background color of the default menu.
final
- constraints → BoxConstraints?
-
Size constraints of the default menu.
final
- elevation → double?
-
Elevation of the default menu.
final
- enableHapticFeedback → bool
-
Vibrate when the menu opens. Defaults to
true.final - enableLongPress → bool
-
Open the menu on a long press. Defaults to
true.final - hashCode → int
-
The hash code for this object.
no setterinherited
- receiverItemsBuilder → BubbleMenuItemsBuilder?
-
Entries of the default menu for receiver bubbles.
final
- receiverMenuHandler → BubbleMenuHandler?
-
Custom presentation for receiver bubbles. Replaces receiverItemsBuilder.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- senderItemsBuilder → BubbleMenuItemsBuilder?
-
Entries of the default menu for sender bubbles.
final
- senderMenuHandler → BubbleMenuHandler?
-
Custom presentation for sender bubbles. Replaces senderItemsBuilder.
final
- shape → ShapeBorder?
-
Shape of the default menu.
final
- surfaceTintColor → Color?
-
Surface tint color of the default menu.
final
-
Push the default menu onto the root navigator.
final
Methods
-
copyWith(
{BubbleMenuItemsBuilder? senderItemsBuilder, BubbleMenuItemsBuilder? receiverItemsBuilder, BubbleMenuHandler? senderMenuHandler, BubbleMenuHandler? receiverMenuHandler, bool? enableLongPress, bool? enableHapticFeedback, Color? color, Color? surfaceTintColor, ShapeBorder? shape, double? elevation, BoxConstraints? constraints, AnimationStyle? animationStyle, }) → BubbleMenuConfiguration - Returns a copy with the given fields replaced.
-
handlerFor(
bool isSender) → BubbleMenuHandler? - Custom handler for the given side.
-
isEnabledFor(
bool isSender) → bool - Whether the given side has a menu at all.
-
itemsBuilderFor(
bool isSender) → BubbleMenuItemsBuilder? - Items builder for the given side.
-
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