mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
now cant use offline device to controll
This commit is contained in:
@ -103,8 +103,30 @@ class DeviceManagementBody extends StatelessWidget with HelperResponsiveLayout {
|
|||||||
decoration: containerDecoration,
|
decoration: containerDecoration,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: DefaultButton(
|
child: DefaultButton(
|
||||||
|
backgroundColor: selectedDevices.any(
|
||||||
|
(element) => !element.online!,
|
||||||
|
)
|
||||||
|
? ColorsManager.primaryColor
|
||||||
|
.withValues(alpha: 0.1)
|
||||||
|
: null,
|
||||||
onPressed: isControlButtonEnabled
|
onPressed: isControlButtonEnabled
|
||||||
? () {
|
? () {
|
||||||
|
if (selectedDevices.any(
|
||||||
|
(element) => !element.online!,
|
||||||
|
)) {
|
||||||
|
ScaffoldMessenger.of(context)
|
||||||
|
.showSnackBar(
|
||||||
|
const SnackBar(
|
||||||
|
content: Text(
|
||||||
|
'This Device is Offline',
|
||||||
|
),
|
||||||
|
duration:
|
||||||
|
Duration(seconds: 2),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (selectedDevices.length == 1) {
|
if (selectedDevices.length == 1) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
Reference in New Issue
Block a user