v1.0.15 AppText
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import 'dart:collection';
|
||||
|
||||
class AppText {
|
||||
late int textId;
|
||||
late String textKey;
|
||||
|
||||
HashMap<String, String> translations = HashMap();
|
||||
|
||||
AppText.fromJson(Map json) {
|
||||
textId = json['textId'];
|
||||
textKey = json['textKey'];
|
||||
|
||||
if (json['translations'] != null && json['translations'].length > 0) {
|
||||
json['translations'].forEach((translation) {
|
||||
translations[translation['languageCode']] = translation['translation'];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"textId": textId,
|
||||
"textKey": textKey,
|
||||
"translations": translations.toString(),
|
||||
};
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user