Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YaruPopupMenuButton improvements #385

Merged
merged 1 commit into from
Nov 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion lib/src/controls/yaru_popup_menu_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ class YaruPopupMenuButton<T> extends StatelessWidget {
this.onSelected,
this.onCanceled,
this.tooltip,
this.position = PopupMenuPosition.under,
this.position = PopupMenuPosition.over,
this.padding = const EdgeInsets.symmetric(horizontal: 5),
this.childPadding = const EdgeInsets.symmetric(horizontal: 5),
this.enabled = true,
this.offset = const Offset(0, 40),
this.enableFeedback,
this.constraints,
this.elevation,
});

final T? initialValue;
Expand All @@ -29,6 +33,10 @@ class YaruPopupMenuButton<T> extends StatelessWidget {
final EdgeInsets padding;
final EdgeInsets childPadding;
final bool enabled;
final Offset offset;
final bool? enableFeedback;
final BoxConstraints? constraints;
final double? elevation;

@override
Widget build(BuildContext context) {
Expand All @@ -38,13 +46,17 @@ class YaruPopupMenuButton<T> extends StatelessWidget {
color: Colors.transparent,
child: PopupMenuButton(
enabled: enabled,
elevation: elevation,
position: position,
padding: EdgeInsets.zero,
initialValue: initialValue,
onSelected: onSelected,
onCanceled: onCanceled,
tooltip: tooltip,
itemBuilder: itemBuilder,
offset: offset,
enableFeedback: enableFeedback,
constraints: constraints,
child: _YaruPopupDecoration(
child: child,
padding: padding,
Expand Down