mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
added the PR notes
This commit is contained in:
@ -62,7 +62,8 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
|
||||
|
||||
final buttonLabel =
|
||||
(selectedDevices.length > 1) ? 'Batch Control' : 'Control';
|
||||
|
||||
final isAnyDeviceOffline =
|
||||
selectedDevices.any((element) => !(element.online ?? false));
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(child: SpaceTreeView(
|
||||
@ -103,17 +104,13 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
|
||||
decoration: containerDecoration,
|
||||
child: Center(
|
||||
child: DefaultButton(
|
||||
backgroundColor: selectedDevices.any(
|
||||
(element) => !element.online!,
|
||||
)
|
||||
backgroundColor: isAnyDeviceOffline
|
||||
? ColorsManager.primaryColor
|
||||
.withValues(alpha: 0.1)
|
||||
: null,
|
||||
onPressed: isControlButtonEnabled
|
||||
? () {
|
||||
if (selectedDevices.any(
|
||||
(element) => !element.online!,
|
||||
)) {
|
||||
if (isAnyDeviceOffline) {
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(
|
||||
const SnackBar(
|
||||
|
Reference in New Issue
Block a user