146 lines
3.6 KiB
Dart
146 lines
3.6 KiB
Dart
import 'dart:convert';
|
|
|
|
class SceneEntity {
|
|
String? sceneType;
|
|
List<SceneList>? sceneList;
|
|
|
|
SceneEntity({
|
|
this.sceneType,
|
|
this.sceneList,
|
|
});
|
|
|
|
SceneEntity copyWith({
|
|
String? sceneType,
|
|
List<SceneList>? sceneList,
|
|
}) =>
|
|
SceneEntity(
|
|
sceneType: sceneType ?? this.sceneType,
|
|
sceneList: sceneList ?? this.sceneList,
|
|
);
|
|
|
|
factory SceneEntity.fromJson(String str) => SceneEntity.fromMap(json.decode(str));
|
|
|
|
String toJson() => json.encode(toMap());
|
|
|
|
factory SceneEntity.fromMap(Map<String, dynamic> json) => SceneEntity(
|
|
sceneType: json["sceneType"],
|
|
sceneList: json["sceneList"] == null ? [] : List<SceneList>.from(json["sceneList"]!.map((x) => SceneList.fromMap(x))),
|
|
);
|
|
|
|
Map<String, dynamic> toMap() => {
|
|
"sceneType": sceneType,
|
|
"sceneList": sceneList == null ? [] : List<dynamic>.from(sceneList!.map((x) => x.toMap())),
|
|
};
|
|
}
|
|
|
|
class SceneList {
|
|
String? english;
|
|
String? sceneType;
|
|
String? chineseSimplified;
|
|
String? spanish;
|
|
String? hindi;
|
|
String? arabic;
|
|
String? portuguese;
|
|
String? bengali;
|
|
String? russian;
|
|
String? punjabi;
|
|
String? javanese;
|
|
String? korean;
|
|
String? french;
|
|
String? german;
|
|
String? japanese;
|
|
|
|
SceneList({
|
|
this.english,
|
|
this.sceneType,
|
|
this.chineseSimplified,
|
|
this.spanish,
|
|
this.hindi,
|
|
this.arabic,
|
|
this.portuguese,
|
|
this.bengali,
|
|
this.russian,
|
|
this.punjabi,
|
|
this.javanese,
|
|
this.korean,
|
|
this.french,
|
|
this.german,
|
|
this.japanese,
|
|
});
|
|
|
|
SceneList copyWith({
|
|
String? english,
|
|
String? sceneType,
|
|
String? chineseSimplified,
|
|
String? spanish,
|
|
String? hindi,
|
|
String? arabic,
|
|
String? portuguese,
|
|
String? bengali,
|
|
String? russian,
|
|
String? punjabi,
|
|
String? javanese,
|
|
String? korean,
|
|
String? french,
|
|
String? german,
|
|
String? japanese,
|
|
}) =>
|
|
SceneList(
|
|
english: english ?? this.english,
|
|
sceneType: sceneType ?? this.sceneType,
|
|
chineseSimplified: chineseSimplified ?? this.chineseSimplified,
|
|
spanish: spanish ?? this.spanish,
|
|
hindi: hindi ?? this.hindi,
|
|
arabic: arabic ?? this.arabic,
|
|
portuguese: portuguese ?? this.portuguese,
|
|
bengali: bengali ?? this.bengali,
|
|
russian: russian ?? this.russian,
|
|
punjabi: punjabi ?? this.punjabi,
|
|
javanese: javanese ?? this.javanese,
|
|
korean: korean ?? this.korean,
|
|
french: french ?? this.french,
|
|
german: german ?? this.german,
|
|
japanese: japanese ?? this.japanese,
|
|
);
|
|
|
|
factory SceneList.fromJson(String str) => SceneList.fromMap(json.decode(str));
|
|
|
|
String toJson() => json.encode(toMap());
|
|
|
|
factory SceneList.fromMap(Map<String, dynamic> json) => SceneList(
|
|
english: json["English"],
|
|
sceneType: json["sceneType"],
|
|
chineseSimplified: json["Chinese (Simplified)"],
|
|
spanish: json["Spanish"],
|
|
hindi: json["Hindi"],
|
|
arabic: json["Arabic"],
|
|
portuguese: json["Portuguese"],
|
|
bengali: json["Bengali"],
|
|
russian: json["Russian"],
|
|
punjabi: json["Punjabi"],
|
|
javanese: json["Javanese"],
|
|
korean: json["Korean"],
|
|
french: json["French"],
|
|
german: json["German"],
|
|
japanese: json["Japanese"],
|
|
);
|
|
|
|
Map<String, dynamic> toMap() => {
|
|
"English": english,
|
|
"sceneType": sceneType,
|
|
"Chinese (Simplified)": chineseSimplified,
|
|
"Spanish": spanish,
|
|
"Hindi": hindi,
|
|
"Arabic": arabic,
|
|
"Portuguese": portuguese,
|
|
"Bengali": bengali,
|
|
"Russian": russian,
|
|
"Punjabi": punjabi,
|
|
"Javanese": javanese,
|
|
"Korean": korean,
|
|
"French": french,
|
|
"German": german,
|
|
"Japanese": japanese,
|
|
};
|
|
}
|