mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 18:16:21 +00:00
Refactor device name display in Action and Condition models
This commit is contained in:
@ -259,6 +259,7 @@ mixin SceneOperationsDataHelper {
|
||||
for (var condition in conditions) {
|
||||
// Create a dummy Action from Condition to reuse _mapExecutorPropertyToSceneFunction
|
||||
Action dummyAction = Action(
|
||||
deviceName: condition.deviceName,
|
||||
productType: condition.productType,
|
||||
actionExecutor: 'device_report',
|
||||
entityId: condition.entityId,
|
||||
@ -369,7 +370,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Sensitivity',
|
||||
isAutomation
|
||||
@ -386,7 +387,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Set Door lock Normal Open',
|
||||
OperationDialogType.onOff,
|
||||
@ -440,7 +441,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Fingerprint Unlock',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -455,7 +456,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Password Unlock',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -470,7 +471,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Card Unlock',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -485,7 +486,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Lock Alarm',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -500,7 +501,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Remote Unlock Request',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -515,7 +516,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Residual Electricity',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -530,7 +531,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Double Lock',
|
||||
OperationDialogType.onOff,
|
||||
@ -545,7 +546,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Remote Unlock Via App',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -560,7 +561,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Hijack Alarm',
|
||||
OperationDialogType.onOff,
|
||||
@ -575,7 +576,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Doorbell',
|
||||
OperationDialogType.onOff,
|
||||
@ -590,7 +591,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'WIFI LOCK PRO',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsDoorLock,
|
||||
'Temporary Password Unlock',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -605,7 +606,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Far Detection',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -620,7 +621,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Motion Detection Sensitivity',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -635,7 +636,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Motionless Detection Sensitivity',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -650,7 +651,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Indicator',
|
||||
OperationDialogType.onOff,
|
||||
@ -665,7 +666,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Nobody Time',
|
||||
OperationDialogType.countdown,
|
||||
@ -680,7 +681,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Presence State',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -695,7 +696,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Current Distance',
|
||||
isAutomation
|
||||
@ -712,7 +713,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Illuminance Value',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -727,7 +728,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Human Presence Sensor',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsSensors,
|
||||
'Self-Test Result',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -742,7 +743,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsAC,
|
||||
'Power',
|
||||
OperationDialogType.onOff,
|
||||
@ -757,7 +758,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsAC,
|
||||
'Set Temperature',
|
||||
isAutomation
|
||||
@ -776,7 +777,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsAC,
|
||||
'Current Temperature',
|
||||
OperationDialogType.integerSteps,
|
||||
@ -791,7 +792,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsAC,
|
||||
'Mode',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -806,7 +807,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsAC,
|
||||
'Fan Speed',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -821,7 +822,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Smart AC Thermostat - Grey - Model A',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsAC,
|
||||
'Child Lock',
|
||||
OperationDialogType.onOff,
|
||||
@ -838,7 +839,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "3G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.assetsIcons3GangSwitch,
|
||||
'Light 1 Switch',
|
||||
OperationDialogType.onOff,
|
||||
@ -850,7 +851,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "2G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'2 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.twoGang,
|
||||
'Light 1 Switch',
|
||||
OperationDialogType.onOff,
|
||||
@ -862,7 +863,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "1G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'1 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.oneGang,
|
||||
'Light 1 Switch',
|
||||
OperationDialogType.onOff,
|
||||
@ -892,7 +893,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "3G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.assetsIcons3GangSwitch,
|
||||
'Light 2 Switch',
|
||||
OperationDialogType.onOff,
|
||||
@ -904,7 +905,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "2G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'2 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.twoGang,
|
||||
'Light 2 Switch',
|
||||
OperationDialogType.onOff,
|
||||
@ -916,7 +917,7 @@ mixin SceneOperationsDataHelper {
|
||||
default:
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'1 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.oneGang,
|
||||
'Light Switch',
|
||||
OperationDialogType.onOff,
|
||||
@ -932,7 +933,7 @@ mixin SceneOperationsDataHelper {
|
||||
String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.assetsIcons3GangSwitch,
|
||||
'Light 3 Switch',
|
||||
OperationDialogType.onOff,
|
||||
@ -949,7 +950,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "3G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.assetsIcons3GangSwitch,
|
||||
'Light 1 CountDown',
|
||||
isAutomation
|
||||
@ -965,7 +966,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "2G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'2 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.twoGang,
|
||||
'Light 1 CountDown',
|
||||
isAutomation
|
||||
@ -981,7 +982,7 @@ mixin SceneOperationsDataHelper {
|
||||
default:
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'1 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.oneGang,
|
||||
'Light CountDown',
|
||||
isAutomation
|
||||
@ -1003,7 +1004,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "3G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.assetsIcons3GangSwitch,
|
||||
'Light 2 CountDown',
|
||||
isAutomation
|
||||
@ -1019,7 +1020,7 @@ mixin SceneOperationsDataHelper {
|
||||
case "2G":
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'2 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.twoGang,
|
||||
'Light 2 CountDown',
|
||||
isAutomation
|
||||
@ -1035,7 +1036,7 @@ mixin SceneOperationsDataHelper {
|
||||
default:
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'1 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.oneGang,
|
||||
'Light CountDown',
|
||||
isAutomation
|
||||
@ -1055,7 +1056,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'3 Gang Button Switch L-L',
|
||||
action.deviceName,
|
||||
Assets.assetsIcons3GangSwitch,
|
||||
'Light 3 CountDown',
|
||||
isAutomation
|
||||
@ -1074,7 +1075,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Gateway',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsGateway,
|
||||
'Switch Alarm Sound',
|
||||
OperationDialogType.onOff,
|
||||
@ -1089,7 +1090,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Gateway',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsGateway,
|
||||
'Master State',
|
||||
OperationDialogType.listOfOptions,
|
||||
@ -1104,7 +1105,7 @@ mixin SceneOperationsDataHelper {
|
||||
bool isAutomation, String? comparator, String? uniqueCustomId) {
|
||||
return _createSceneFunction(
|
||||
action,
|
||||
'Gateway',
|
||||
action.deviceName,
|
||||
Assets.assetsIconsGateway,
|
||||
'Factory Reset',
|
||||
OperationDialogType.onOff,
|
||||
@ -1447,6 +1448,7 @@ mixin SceneOperationsDataHelper {
|
||||
return [
|
||||
_mapExecutorPropertyToSceneFunction(
|
||||
Action(
|
||||
deviceName: taskItem.deviceName,
|
||||
productType: '',
|
||||
entityId: deviceId,
|
||||
executorProperty: ExecutorProperty(
|
||||
|
@ -76,6 +76,8 @@ class Action {
|
||||
String? type;
|
||||
final String productType;
|
||||
|
||||
final String deviceName;
|
||||
|
||||
Action({
|
||||
required this.actionExecutor,
|
||||
required this.entityId,
|
||||
@ -83,6 +85,7 @@ class Action {
|
||||
this.name,
|
||||
this.type,
|
||||
required this.productType,
|
||||
required this.deviceName,
|
||||
});
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
@ -95,6 +98,7 @@ class Action {
|
||||
name: json['name'] as String?,
|
||||
type: json['type'] as String?,
|
||||
productType: json['productType'] as String,
|
||||
deviceName: json['deviceName'] as String,
|
||||
);
|
||||
}
|
||||
if (json["executorProperty"] == null) {
|
||||
@ -106,6 +110,7 @@ class Action {
|
||||
entityId: json["entityId"] as String,
|
||||
executorProperty: ExecutorProperty.fromJson(json["executorProperty"]),
|
||||
productType: json['productType'] as String,
|
||||
deviceName: json['deviceName'] as String,
|
||||
);
|
||||
}
|
||||
|
||||
@ -147,6 +152,7 @@ class Condition {
|
||||
final String entityType;
|
||||
final Expr expr;
|
||||
final String productType;
|
||||
final String deviceName;
|
||||
|
||||
Condition({
|
||||
required this.code,
|
||||
@ -154,6 +160,7 @@ class Condition {
|
||||
required this.entityType,
|
||||
required this.expr,
|
||||
required this.productType,
|
||||
required this.deviceName,
|
||||
});
|
||||
|
||||
factory Condition.fromRawJson(String str) =>
|
||||
@ -167,6 +174,7 @@ class Condition {
|
||||
entityType: json["entityType"],
|
||||
expr: Expr.fromJson(json["expr"]),
|
||||
productType: json['productType'] as String,
|
||||
deviceName: json['deviceName'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
@ -12,12 +12,10 @@ import 'package:syncrow_app/features/scene/widgets/scene_list_tile.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_container.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/light_divider.dart';
|
||||
import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart';
|
||||
import 'package:syncrow_app/generated/assets.dart';
|
||||
import 'package:syncrow_app/navigation/navigate_to_route.dart';
|
||||
import 'package:syncrow_app/navigation/routing_constants.dart';
|
||||
import 'package:syncrow_app/utils/context_extension.dart';
|
||||
|
||||
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
|
||||
|
||||
class DeviceFunctionsView extends StatelessWidget
|
||||
@ -69,14 +67,13 @@ class DeviceFunctionsView extends StatelessWidget
|
||||
itemCount: functions.length,
|
||||
padding: const EdgeInsets.only(top: 24.0),
|
||||
itemBuilder: (context, index) {
|
||||
if (device.productType!.name.toString() == 'ThreeGang' ||
|
||||
device.productType!.name.toString() == 'TwoGang') {
|
||||
final bool isFirstInPair = index % 2 == 0;
|
||||
final bool isLastInPair =
|
||||
index % 2 == 1 || index == functions.length - 1;
|
||||
final bool isLastItem = index == functions.length - 1;
|
||||
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
return Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
if (isFirstInPair && index != 0) const SizedBox(height: 16),
|
||||
DefaultContainer(
|
||||
padding: EdgeInsets.only(
|
||||
@ -124,9 +121,73 @@ class DeviceFunctionsView extends StatelessWidget
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
]);
|
||||
} else {
|
||||
return DefaultContainer(
|
||||
padding: index == 0
|
||||
? const EdgeInsets.only(top: 8)
|
||||
: index == functions.length - 1
|
||||
? const EdgeInsets.only(bottom: 8)
|
||||
: EdgeInsets.zero,
|
||||
margin: EdgeInsets.zero,
|
||||
borderRadius: index == 0 && index == functions.length - 1
|
||||
? const BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
bottomLeft: Radius.circular(20),
|
||||
bottomRight: Radius.circular(20),
|
||||
)
|
||||
: index == 0
|
||||
? const BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
)
|
||||
: index == functions.length - 1
|
||||
? const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(20),
|
||||
bottomRight: Radius.circular(20),
|
||||
)
|
||||
: BorderRadius.zero,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
BlocBuilder<CreateSceneBloc, CreateSceneState>(
|
||||
builder: (context, state) {
|
||||
return SceneListTile(
|
||||
iconsSize: 22,
|
||||
minLeadingWidth: 20,
|
||||
assetPath: functions[index].icon,
|
||||
titleString: functions[index].operationName,
|
||||
trailingWidget: const Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.arrow_forward_ios_rounded,
|
||||
color: ColorsManager.greyColor,
|
||||
size: 16,
|
||||
),
|
||||
],
|
||||
),
|
||||
onPressed: () {
|
||||
if (isAutomation) {
|
||||
_showAutomationDialog(
|
||||
context, functions[index], device);
|
||||
} else {
|
||||
_showTabToRunDialog(
|
||||
context, functions[index], device);
|
||||
}
|
||||
},
|
||||
);
|
||||
}),
|
||||
index != functions.length - 1
|
||||
? SizedBox(
|
||||
width: context.width * 0.8,
|
||||
child: const LightDivider())
|
||||
: const SizedBox(),
|
||||
],
|
||||
));
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
|
Reference in New Issue
Block a user