WT 1.1.5+2 remote images for menu

This commit is contained in:
bossanyit
2021-01-31 12:59:52 +01:00
parent 71efd3f349
commit c1a57dd10e
88 changed files with 743 additions and 316 deletions
+4
View File
@@ -62,7 +62,11 @@ class UserRepository with Logging {
} else if (e.code == 'weak-password') {
log('The password provided is too weak.');
throw Exception("Password too short");
} else if (e.code == 'account-exists-with-different-credential') {
log(e.code);
throw Exception("The account exists with different credential");
} else {
print(e.code);
throw Exception(e);
}
} on WorkoutTestException catch (ex) {
+4 -14
View File
@@ -47,22 +47,12 @@ class WorkoutTreeRepository with Logging {
Antagonist.calf: Antagonist.calfNr
};
/* Future<String> _buildImage(String imageUrl) async {
String assetImage = 'asset/menu/' + imageUrl.substring(7);
//print("Loading image " + assetImage);
return rootBundle.load(assetImage).then((value) {
return assetImage;
}).catchError((_) {
String imagePath = assetImage.substring(10);
String url = Cache.mediaUrl + 'images' + imagePath;
//print("Exception: " + assetImage + " will be loaded from the network " + url);
return url;
});
} */
Future<void> createTree() async {
isEnglish = AppLanguage().appLocal == Locale('en');
log("** Start creating tree on lang: " + AppLanguage().appLocal.languageCode);
log("** Start creating tree on lang: " +
AppLanguage().appLocal.languageCode +
" tree length: " +
Cache().getExerciseTree().length.toString());
List<ExerciseTree> exerciseTree = Cache().getExerciseTree();
if (exerciseTree == null || exerciseTree.length == 0) {