WT1.1.23 TrainingPlans generation extension, minor fixes

This commit is contained in:
bossanyit
2021-09-11 07:42:10 +02:00
parent 4e9afbd4b3
commit cc836605fa
28 changed files with 236 additions and 96 deletions
+9
View File
@@ -125,6 +125,7 @@ class Cache with Logging {
AccessToken? accessTokenFacebook;
Customer? userLoggedIn;
String? firebaseUid;
String? firebaseMessageToken;
LoginType? loginType;
PackageInfo? packageInfo;
@@ -699,6 +700,14 @@ class Cache with Logging {
await isActivityDonePrefs(activity);
});
print("Firebase token save: $firebaseMessageToken");
if (userLoggedIn!.firebaseRegToken == null && firebaseMessageToken != null) {
userLoggedIn!.firebaseRegToken = firebaseMessageToken;
CustomerRepository customerRepository = CustomerRepository();
customerRepository.customer = userLoggedIn;
customerRepository.saveCustomer();
}
await getMyTrainingPlan();
Cache().startPage = "home";
+3
View File
@@ -26,6 +26,7 @@ class Customer {
int? sportId;
DateTime? syncedDate;
DateTime? trialDate;
String? firebaseRegToken;
LinkedHashMap<String, CustomerProperty> properties = LinkedHashMap();
@@ -68,6 +69,7 @@ class Customer {
this.trainer = json['trainer'];
this.firebaseUid = json['firebaseUid'];
this.firebaseRegToken = json['firebaseRegToken'];
this.dataPolicyAllowed = json['dataPolicyAllowed'];
this.emailSubscription = json['emailSubscription'];
@@ -100,6 +102,7 @@ class Customer {
"sportId": this.sportId,
"syncedDate": this.syncedDate == null ? null : DateFormat('yyyy-MM-dd HH:mm:ss').format(this.syncedDate!),
"trialDate": this.trialDate == null ? null : DateFormat('yyyy-MM-dd HH:mm:ss').format(this.trialDate!),
"firebaseRegToken": this.firebaseRegToken,
};
@override
+3 -1
View File
@@ -10,6 +10,7 @@ class Mautic {
String? language;
String? purchaseDate;
String? exerciseDate;
String? trialDate;
Map<String, dynamic> toJson() => {
"formId": this.formId,
@@ -31,10 +32,11 @@ class Mautic {
form += this.fitnessLevel == null ? "" : "&mauticform[fitness_level]=${this.fitnessLevel}";
form += this.goal == null ? "" : "&mauticform[goal]=${this.goal}";
form += this.subscriptionDate == null ? "" : "&mauticform[subscribed]=${this.subscriptionDate}";
form += this.databaseId == null ? "" : "&mauticform[database_id]=${this.databaseId}";
form += this.databaseId == null ? "" : "&mauticform[databaseid]=${this.databaseId}";
form += this.language == null ? "" : "&mauticform[language]=${this.language}";
form += this.purchaseDate == null ? "" : "&mauticform[purchase_date]=${this.purchaseDate}";
form += this.exerciseDate == null ? "" : "&mauticform[last_exercise]=${this.exerciseDate}";
form += this.trialDate == null ? "" : "&mauticform[trialdate]=${this.trialDate}";
return form;
}