WT 1.1.17 FAQ,
This commit is contained in:
@@ -9,6 +9,7 @@ import 'package:aitrainer_app/model/exercise_plan_detail.dart';
|
||||
import 'package:aitrainer_app/model/exercise_plan_template.dart';
|
||||
import 'package:aitrainer_app/model/exercise_tree.dart';
|
||||
import 'package:aitrainer_app/model/exercise.dart';
|
||||
import 'package:aitrainer_app/model/faq.dart';
|
||||
import 'package:aitrainer_app/model/model_change.dart';
|
||||
import 'package:aitrainer_app/model/product.dart' as wt_product;
|
||||
import 'package:aitrainer_app/model/product.dart';
|
||||
@@ -143,6 +144,7 @@ class Cache with Logging {
|
||||
List<CustomerActivity>? _customerActivities;
|
||||
List<Tutorial>? _tutorials;
|
||||
List<Description>? _descriptions;
|
||||
List<Faq>? _faqs;
|
||||
|
||||
LinkedHashMap<int, ExercisePlanDetail> _myExercisesPlanDetails = LinkedHashMap<int, ExercisePlanDetail>();
|
||||
|
||||
@@ -684,4 +686,7 @@ class Cache with Logging {
|
||||
|
||||
List<Description>? getDescriptions() => this._descriptions;
|
||||
setDescriptions(List<Description>? value) => this._descriptions = value;
|
||||
|
||||
List<Faq>? getFaqs() => this._faqs;
|
||||
setFaqs(List<Faq>? value) => this._faqs = value;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:aitrainer_app/util/app_language.dart';
|
||||
|
||||
class Faq {
|
||||
late int faqId;
|
||||
late String name;
|
||||
late String description;
|
||||
int? sort;
|
||||
|
||||
HashMap<String, String> nameTranslations = HashMap();
|
||||
HashMap<String, String> descriptionTranslations = HashMap();
|
||||
|
||||
Faq.fromJson(Map json) {
|
||||
this.faqId = json['faqId'];
|
||||
this.name = json['name'];
|
||||
this.description = json['description'];
|
||||
this.sort = json['sort'];
|
||||
|
||||
nameTranslations['en'] = name;
|
||||
descriptionTranslations['en'] = description;
|
||||
if (json['translations'] != null && json['translations'].length > 0) {
|
||||
json['translations'].forEach((translation) {
|
||||
nameTranslations[translation['languageCode']] = translation['nameTranslation'];
|
||||
descriptionTranslations[translation['languageCode']] = translation['descriptionTranslation'];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"faqId": this.faqId,
|
||||
"name": this.name,
|
||||
"description": this.description,
|
||||
"nameTranslation": this.nameTranslations.toString(),
|
||||
};
|
||||
|
||||
@override
|
||||
String toString() => this.toJson().toString();
|
||||
}
|
||||
Reference in New Issue
Block a user