added routines details apis

This commit is contained in:
ashraf_personal
2024-11-28 01:11:31 +03:00
parent 9b5ddc4dc8
commit e50a6d4c4b
7 changed files with 256 additions and 38 deletions

View File

@ -24,7 +24,14 @@ class ScenesModel {
String toRawJson() => json.encode(toJson());
Uint8List get iconInBytes => base64Decode(icon ?? '');
Uint8List? get iconInBytes {
if (icon == null || icon?.isEmpty == true) return null;
try {
return base64Decode(icon!);
} catch (e) {
return null;
}
}
factory ScenesModel.fromJson(Map<String, dynamic> json,
{bool? isAutomation}) {