now cant use offline device to controll

This commit is contained in:
raf-dev1
2025-06-23 14:33:56 +03:00
parent 03a6c5474b
commit 1200a809c2

View File

@ -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,