mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
31 lines
787 B
Dart
31 lines
787 B
Dart
import 'dart:convert';
|
|
|
|
class ScenesModel {
|
|
final String id;
|
|
final String name;
|
|
final String status;
|
|
final String type;
|
|
final String? icon;
|
|
|
|
ScenesModel({required this.id, required this.name, required this.status, required this.type, this.icon});
|
|
|
|
factory ScenesModel.fromRawJson(String str) => ScenesModel.fromJson(json.decode(str));
|
|
|
|
String toRawJson() => json.encode(toJson());
|
|
|
|
factory ScenesModel.fromJson(Map<String, dynamic> json) => ScenesModel(
|
|
id: json["id"],
|
|
name: json["name"] ?? '',
|
|
status: json["status"] ?? '',
|
|
type: json["type"] ?? '',
|
|
icon: json["icon"] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"id": id,
|
|
"name": name,
|
|
"status": status,
|
|
"type": type,
|
|
};
|
|
}
|