mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-13 17:02:10 +00:00
show curtain in devices and implement dialog for if and then
last integrate with backend
This commit is contained in:
49
lib/pages/routines/models/curtain/curtain_function.dart
Normal file
49
lib/pages/routines/models/curtain/curtain_function.dart
Normal file
@ -0,0 +1,49 @@
|
||||
import 'package:syncrow_web/pages/device_managment/curtain/model/curtain_model.dart';
|
||||
import 'package:syncrow_web/pages/routines/models/curtain/curtain_opertion_value.dart';
|
||||
import 'package:syncrow_web/pages/routines/models/device_functions.dart'
|
||||
show DeviceFunction;
|
||||
import 'package:syncrow_web/utils/constants/app_enum.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
|
||||
abstract class CurtainFunction extends DeviceFunction<CurtainModel> {
|
||||
final String type;
|
||||
CurtainFunction({
|
||||
required super.deviceId,
|
||||
required super.deviceName,
|
||||
required this.type,
|
||||
required super.code,
|
||||
required super.operationName,
|
||||
required super.icon,
|
||||
});
|
||||
List<CurtainOperationalValue> getOperationalValues();
|
||||
}
|
||||
|
||||
class ControlFunction extends CurtainFunction {
|
||||
ControlFunction({
|
||||
required super.deviceId,
|
||||
required super.deviceName,
|
||||
required super.type,
|
||||
super.code = 'control',
|
||||
super.operationName = 'Control',
|
||||
super.icon = Assets.curtain,
|
||||
});
|
||||
|
||||
@override
|
||||
List<CurtainOperationalValue> getOperationalValues() => [
|
||||
CurtainOperationalValue(
|
||||
icon: Assets.curtain,
|
||||
description: 'OPEN',
|
||||
value: 'open',
|
||||
),
|
||||
CurtainOperationalValue(
|
||||
icon: Assets.curtain,
|
||||
description: 'STOP',
|
||||
value: 'stop',
|
||||
),
|
||||
CurtainOperationalValue(
|
||||
icon: Assets.curtain,
|
||||
description: 'CLOSE',
|
||||
value: 'close',
|
||||
)
|
||||
];
|
||||
}
|
Reference in New Issue
Block a user