workouttest_util/lib/model/app_text.dart
2023-03-19 09:51:05 +01:00

31 lines
680 B
Dart

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();
}
}