showMenu<T> function
Future<T?>
showMenu<T>({
- required BuildContext context,
- required RelativeRect position,
- required List<
PopupMenusEntry< items,T> > - T? initialValue,
- double? elevation,
- String? semanticLabel,
- ShapeBorder? shape,
- Color? color,
- bool blur = false,
Implementation
Future<T?> showMenu<T>({
required BuildContext context,
required RelativeRect position,
required List<PopupMenusEntry<T>> items,
T? initialValue,
double? elevation,
String? semanticLabel,
ShapeBorder? shape,
Color? color,
bool blur = false,
bool useRootNavigator = false,
}) {
assert(context != null);
assert(position != null);
assert(useRootNavigator != null);
assert(items != null && items.isNotEmpty);
assert(debugCheckHasMaterialLocalizations(context));
switch (Theme.of(context).platform) {
case TargetPlatform.iOS:
case TargetPlatform.macOS:
break;
case TargetPlatform.android:
case TargetPlatform.fuchsia:
case TargetPlatform.linux:
case TargetPlatform.windows:
semanticLabel ??= MaterialLocalizations.of(context).popupMenuLabel;
}
final NavigatorState navigator = Navigator.of(context, rootNavigator: useRootNavigator);
return navigator.push(_PopupMenusRoute<T>(
position: position,
items: items,
initialValue: initialValue,
elevation: elevation,
semanticLabel: semanticLabel,
barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
shape: shape,
color: color,
blur: blur,
capturedThemes: InheritedTheme.capture(from: context, to: navigator.context),
));
}