Fixed show in device bug

This commit is contained in:
hannathkadher
2024-11-05 12:52:11 +04:00
parent 52f6be3db0
commit e9615cd351

View File

@ -1,5 +1,4 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:ffi';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
@ -10,7 +9,6 @@ class CreateSceneModel {
String sceneName; String sceneName;
String decisionExpr; String decisionExpr;
List<CreateSceneAction> actions; List<CreateSceneAction> actions;
bool showInHomePage;
CreateSceneModel({ CreateSceneModel({
required this.spaceUuid, required this.spaceUuid,
@ -19,7 +17,6 @@ class CreateSceneModel {
required this.sceneName, required this.sceneName,
required this.decisionExpr, required this.decisionExpr,
required this.actions, required this.actions,
this.showInHomePage = false,
}); });
CreateSceneModel copyWith({ CreateSceneModel copyWith({
@ -38,7 +35,6 @@ class CreateSceneModel {
sceneName: sceneName ?? this.sceneName, sceneName: sceneName ?? this.sceneName,
decisionExpr: decisionExpr ?? this.decisionExpr, decisionExpr: decisionExpr ?? this.decisionExpr,
actions: actions ?? this.actions, actions: actions ?? this.actions,
showInHomePage: showInHomePage ?? this.showInHomePage,
); );
} }
@ -50,16 +46,14 @@ class CreateSceneModel {
'sceneName': sceneName, 'sceneName': sceneName,
'decisionExpr': decisionExpr, 'decisionExpr': decisionExpr,
'actions': actions.map((x) => x.toMap()).toList(), 'actions': actions.map((x) => x.toMap()).toList(),
'showInHomePage': showInHomePage,
}; };
} }
factory CreateSceneModel.fromMap(Map<String, dynamic> map) { factory CreateSceneModel.fromMap(Map<String, dynamic> map) {
return CreateSceneModel( return CreateSceneModel(
spaceUuid: map['spaceUuid'] ?? '', spaceUuid: map['spaceUuid'] ?? '',
showInHomePage: map['showInHomePage'] ?? false,
iconId: map['iconUuid'] ?? '',
showInDevice: map['showInHomePage'] ?? false, showInDevice: map['showInHomePage'] ?? false,
iconId: map['iconUuid'] ?? '',
sceneName: map['sceneName'] ?? '', sceneName: map['sceneName'] ?? '',
decisionExpr: map['decisionExpr'] ?? '', decisionExpr: map['decisionExpr'] ?? '',
actions: List<CreateSceneAction>.from( actions: List<CreateSceneAction>.from(
@ -87,8 +81,7 @@ class CreateSceneModel {
other.showInDevice == showInDevice && other.showInDevice == showInDevice &&
other.sceneName == sceneName && other.sceneName == sceneName &&
other.decisionExpr == decisionExpr && other.decisionExpr == decisionExpr &&
listEquals(other.actions, actions) && listEquals(other.actions, actions);
other.showInHomePage == showInHomePage;
} }
@override @override