|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public static partial class PopupMenuUtils { |
|
|
|
public static IPromise<T> showMenu<T>( |
|
|
|
public static IPromise<object> showMenu<T>( |
|
|
|
BuildContext context, |
|
|
|
RelativeRect position, |
|
|
|
List<PopupMenuEntry<T>> items, |
|
|
|
|
|
|
initialValue: initialValue, |
|
|
|
elevation: elevation, |
|
|
|
theme: Theme.of(context, shadowThemeOnly: true) |
|
|
|
)).Then(result => (T) result); |
|
|
|
)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
), |
|
|
|
Offset.zero & overlay.size |
|
|
|
); |
|
|
|
PopupMenuUtils.showMenu<T>( |
|
|
|
PopupMenuUtils.showMenu( |
|
|
|
context: this.context, |
|
|
|
elevation: this.widget.elevation, |
|
|
|
items: this.widget.itemBuilder(this.context), |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (this.widget.onSelected != null) { |
|
|
|
this.widget.onSelected(newValue); |
|
|
|
this.widget.onSelected((T) newValue); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|