diff --git a/lib/pages/routines/widgets/routine_devices.dart b/lib/pages/routines/widgets/routine_devices.dart index ba5756e0..f6ff0db9 100644 --- a/lib/pages/routines/widgets/routine_devices.dart +++ b/lib/pages/routines/widgets/routine_devices.dart @@ -17,6 +17,8 @@ class _RoutineDevicesState extends State { context.read().add(FetchDevicesInRoutine()); } + static const _allowedProductTypes = {'AC', '1G', '2G', '3G', 'WPS', 'GW'}; + @override Widget build(BuildContext context) { return BlocBuilder( @@ -31,10 +33,9 @@ class _RoutineDevicesState extends State { } }); - final deviceList = state.devices.where((device) { - const allowedProductTypes = {'AC', '1G', '2G', '3G', 'WPS', 'GW'}; - return allowedProductTypes.contains(device.productType); - }).toList(); + final deviceList = state.devices + .where((device) => _allowedProductTypes.contains(device.productType)) + .toList(); return Wrap( spacing: 10,