mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-14 17:25:50 +00:00
added the PR notes
This commit is contained in:
@ -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(
|
||||||
|
Reference in New Issue
Block a user