Skip to content

Commit

Permalink
feat: right click to open track option
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Sep 10, 2023
1 parent d4f99ec commit 1540999
Show file tree
Hide file tree
Showing 3 changed files with 377 additions and 327 deletions.
25 changes: 25 additions & 0 deletions lib/components/shared/adaptive/adaptive_pop_sheet_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,31 @@ class AdaptivePopSheetList<T> extends StatelessWidget {
'Either icon or child must be provided',
);

Future<T?> showPopupMenu(BuildContext context, RelativeRect position) {
final mediaQuery = MediaQuery.of(context);

return showMenu<T>(
context: context,
useRootNavigator: useRootNavigator,
constraints: BoxConstraints(
maxHeight: mediaQuery.size.height * 0.6,
),
position: position,
items: children
.map(
(item) => PopupMenuItem<T>(
padding: EdgeInsets.zero,
enabled: false,
child: _AdaptivePopSheetListItem<T>(
item: item,
onSelected: onSelected,
),
),
)
.toList(),
);
}

@override
Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context);
Expand Down
Loading

0 comments on commit 1540999

Please sign in to comment.