File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
client/lib/features/devices/views Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -187,12 +187,19 @@ class DeviceCard extends StatelessWidget {
187187 iconSize: 18 ,
188188 icon: Icon (Icons .more_vert, color: fgColor.withValues (alpha: 0.7 )),
189189 onSelected: (value) => _handleMenuAction (context, value),
190- itemBuilder: (BuildContext ctx) => [
191- PopupMenuItem <String >(value: 'reconnect' , child: Text (context.translate ('Reconnect' ))),
192- const PopupMenuDivider (),
193- PopupMenuItem <String >(value: 'change-group' , child: Text (context.translate ('Change group...' ))),
194- PopupMenuItem <String >(value: 'delete' , child: Text (context.translate ('Delete...' ))),
195- ],
190+ itemBuilder: (BuildContext ctx) {
191+ final showChangeGroup = ctx.read <GroupedDevicesViewModel >().groups.length > 1 ;
192+
193+ final entries = < PopupMenuEntry <String >> [
194+ PopupMenuItem <String >(value: 'reconnect' , child: Text (context.translate ('Reconnect' ))),
195+ ];
196+ entries.add (const PopupMenuDivider ());
197+ if (showChangeGroup) {
198+ entries.add (PopupMenuItem <String >(value: 'change-group' , child: Text (context.translate ('Change group...' ))));
199+ }
200+ entries.add (PopupMenuItem <String >(value: 'delete' , child: Text (context.translate ('Delete...' ))));
201+ return entries;
202+ },
196203 );
197204 }
198205
You can’t perform that action at this time.
0 commit comments