added the PR notes

This commit is contained in:
raf-dev1
2025-06-23 16:05:16 +03:00
parent 1200a809c2
commit ad00cf35ba

View File

@ -62,7 +62,8 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
final buttonLabel = final buttonLabel =
(selectedDevices.length > 1) ? 'Batch Control' : 'Control'; (selectedDevices.length > 1) ? 'Batch Control' : 'Control';
final isAnyDeviceOffline =
selectedDevices.any((element) => !(element.online ?? false));
return Row( return Row(
children: [ children: [
Expanded(child: SpaceTreeView( Expanded(child: SpaceTreeView(
@ -103,17 +104,13 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
decoration: containerDecoration, decoration: containerDecoration,
child: Center( child: Center(
child: DefaultButton( child: DefaultButton(
backgroundColor: selectedDevices.any( backgroundColor: isAnyDeviceOffline
(element) => !element.online!,
)
? ColorsManager.primaryColor ? ColorsManager.primaryColor
.withValues(alpha: 0.1) .withValues(alpha: 0.1)
: null, : null,
onPressed: isControlButtonEnabled onPressed: isControlButtonEnabled
? () { ? () {
if (selectedDevices.any( if (isAnyDeviceOffline) {
(element) => !element.online!,
)) {
ScaffoldMessenger.of(context) ScaffoldMessenger.of(context)
.showSnackBar( .showSnackBar(
const SnackBar( const SnackBar(