@@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
33import 'package:kitchenowl/cubits/household_cubit.dart' ;
44import 'package:kitchenowl/enums/update_enum.dart' ;
55import 'package:kitchenowl/helpers/build_context_extension.dart' ;
6+ import 'package:kitchenowl/helpers/url_launcher.dart' ;
67import 'package:kitchenowl/kitchenowl.dart' ;
78import 'package:kitchenowl/models/category.dart' ;
89import 'package:kitchenowl/models/item.dart' ;
@@ -88,6 +89,41 @@ class SliverItemGridList<T extends Item> extends StatelessWidget {
8889 }
8990
9091 Future <void > openMenu (BuildContext context, Item item) async {
92+ final url =
93+ item is ItemWithDescription ? extractSingleUrl (item.description) : null ;
94+ if (url == null ) return _openItemPage (context, item);
95+
96+ await showModalBottomSheet <void >(
97+ context: context,
98+ showDragHandle: true ,
99+ builder: (ctx) => SafeArea (
100+ child: Column (
101+ mainAxisSize: MainAxisSize .min,
102+ children: [
103+ ListTile (
104+ leading: const Icon (Icons .edit_outlined),
105+ title: Text (AppLocalizations .of (ctx)! .edit),
106+ onTap: () {
107+ Navigator .of (ctx).pop ();
108+ _openItemPage (context, item);
109+ },
110+ ),
111+ ListTile (
112+ leading: const Icon (Icons .open_in_new_rounded),
113+ title: Text (AppLocalizations .of (ctx)! .openUrl),
114+ onTap: () {
115+ Navigator .of (ctx).pop ();
116+ openUrl (context, url);
117+ },
118+ ),
119+ const SizedBox (height: 8 ),
120+ ],
121+ ),
122+ ),
123+ );
124+ }
125+
126+ Future <void > _openItemPage (BuildContext context, Item item) async {
91127 final res = await Navigator .of (context, rootNavigator: true )
92128 .push <UpdateValue <Item >>(
93129 MaterialPageRoute (builder: (ctx) {
0 commit comments