WT 1.1.14+2 sales page update
This commit is contained in:
+19
-1
@@ -2,6 +2,7 @@ import 'dart:collection';
|
||||
import 'dart:convert';
|
||||
import 'package:aitrainer_app/model/customer.dart';
|
||||
import 'package:aitrainer_app/model/customer_activity.dart';
|
||||
import 'package:aitrainer_app/model/description.dart';
|
||||
import 'package:aitrainer_app/model/evaluation.dart';
|
||||
import 'package:aitrainer_app/model/exercise_plan.dart';
|
||||
import 'package:aitrainer_app/model/exercise_plan_detail.dart';
|
||||
@@ -25,6 +26,7 @@ import 'package:aitrainer_app/main.dart';
|
||||
import 'package:aitrainer_app/util/enums.dart';
|
||||
import 'package:aitrainer_app/util/env.dart';
|
||||
import 'package:aitrainer_app/util/track.dart';
|
||||
import 'package:firebase_remote_config/firebase_remote_config.dart';
|
||||
import 'package:flurry/flurry.dart';
|
||||
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
|
||||
import 'package:flutter_uxcam/flutter_uxcam.dart';
|
||||
@@ -58,7 +60,14 @@ enum SharePrefsChange {
|
||||
- is_logged_in
|
||||
*/
|
||||
|
||||
enum ActivityDone { tutorialBasic, tutorialDevelopment, isExerciseLogSeen, isMuscleDevelopmentSeen }
|
||||
enum ActivityDone {
|
||||
tutorialBasic,
|
||||
tutorialBasicChestPress,
|
||||
tutorialBasicLegPress,
|
||||
tutorialDevelopment,
|
||||
isExerciseLogSeen,
|
||||
isMuscleDevelopmentSeen
|
||||
}
|
||||
|
||||
extension ActivityDoneExt on ActivityDone {
|
||||
String toStr() => this.toString().split(".").last;
|
||||
@@ -131,6 +140,7 @@ class Cache with Logging {
|
||||
List<CustomerExerciseDevice>? _customerDevices;
|
||||
List<CustomerActivity>? _customerActivities;
|
||||
List<Tutorial>? _tutorials;
|
||||
List<Description>? _descriptions;
|
||||
|
||||
LinkedHashMap<int, ExercisePlanDetail> _myExercisesPlanDetails = LinkedHashMap<int, ExercisePlanDetail>();
|
||||
|
||||
@@ -141,6 +151,8 @@ class Cache with Logging {
|
||||
List<Exercise>? _exercisesTrainee;
|
||||
ExercisePlan? _traineeExercisePlan;
|
||||
|
||||
RemoteConfig? remoteConfig;
|
||||
|
||||
LinkedHashMap<String, int> _badges = LinkedHashMap();
|
||||
|
||||
List? deviceLanguages;
|
||||
@@ -664,4 +676,10 @@ class Cache with Logging {
|
||||
|
||||
List<Tutorial>? get tutorials => this._tutorials;
|
||||
setTutorials(List<Tutorial>? value) => this._tutorials = value;
|
||||
|
||||
RemoteConfig? getRemoteConfig() => this.remoteConfig;
|
||||
setRemoteConfig(RemoteConfig? remoteConfig) => this.remoteConfig = remoteConfig;
|
||||
|
||||
List<Description>? getDescriptions() => this._descriptions;
|
||||
setDescriptions(List<Description>? value) => this._descriptions = value;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import 'package:aitrainer_app/util/app_language.dart';
|
||||
import 'dart:ui';
|
||||
|
||||
class Description {
|
||||
late int descriptionId;
|
||||
late String name;
|
||||
late String description;
|
||||
int? version;
|
||||
DateTime? validFrom;
|
||||
DateTime? validTo;
|
||||
|
||||
String? descriptionTranslation;
|
||||
|
||||
Description.fromJson(Map json) {
|
||||
this.descriptionId = json['descriptionId'];
|
||||
this.name = json['name'];
|
||||
this.description = json['description'];
|
||||
this.version = json['version'];
|
||||
this.validFrom = json['validFrom'];
|
||||
this.validTo = json['validTo'];
|
||||
|
||||
if (json['translations'] != null && json['translations'].length > 0) {
|
||||
this.descriptionTranslation =
|
||||
AppLanguage().appLocal == Locale('hu') ? json['translations'][0]['descriptionTranslation'] : json['description'];
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"descriptionId": this.descriptionId,
|
||||
"name": this.name,
|
||||
"description": this.description,
|
||||
"version": this.version,
|
||||
"validFrom": this.validFrom,
|
||||
"validTo": this.validTo,
|
||||
"descriptionTranslation": this.descriptionTranslation
|
||||
};
|
||||
|
||||
@override
|
||||
String toString() => this.toJson().toString();
|
||||
}
|
||||
@@ -46,6 +46,7 @@ class Product {
|
||||
'productIdAndroid': this.productIdAndroid,
|
||||
'priceIos': this.priceIos,
|
||||
'priceAndroid': this.priceAndroid,
|
||||
'localizedPrice': this.localizedPrice
|
||||
};
|
||||
return json.toString();
|
||||
}
|
||||
|
||||
@@ -14,6 +14,19 @@ class Tutorial {
|
||||
|
||||
if (json['steps'] != null && json['steps'].length > 0) {
|
||||
steps = json['steps'].map<TutorialStep>((step) => TutorialStep.fromJson(step)).toList();
|
||||
if (steps != null) {
|
||||
steps!.sort((a, b) {
|
||||
if (a.step == null || b.step == null) {
|
||||
return -1;
|
||||
} else {
|
||||
if (a.step! <= b.step!) {
|
||||
return -1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,6 @@ class TutorialStep {
|
||||
this.condition = json['condition'];
|
||||
if (this.condition != null) {
|
||||
this.condition = condition!.replaceAll(r'\\', "replace");
|
||||
print("Json condition $condition");
|
||||
this.action = TutorialStepAction.fromJson(jsonDecode(condition!));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user