Skip to content

Commit

Permalink
fix #4 handle no pp set in login
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurBeaulieu committed Jun 24, 2024
1 parent a0a07e5 commit 95614b6
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ android {
applicationId "com.messebasseproduction.beercrackerz"
multiDexEnabled true
minSdkVersion 20
versionCode 4
versionName "0.0.5"
versionCode 6
versionName "0.0.6"
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
Binary file added assets/images/icon/profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion lib/src/auth/profile_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,9 @@ class ProfileViewState extends State<ProfileView> {
width: (MediaQuery.of(context).size.width / 2),
decoration: BoxDecoration(
image: DecorationImage(
image: NetworkImage('${AppConst.baseURL}${widget.settingsController.ppPath}'),
image: (widget.settingsController.ppPath.contains('profile.png') == true)
? AssetImage(widget.settingsController.ppPath) as ImageProvider // Load local default PP
: NetworkImage('${AppConst.baseURL}${widget.settingsController.ppPath}'), // Load server one
fit: BoxFit.fill,
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/src/localization/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
}
},
"authProfileAboutBeerCrackerz": "BeerCrackerz ist die Community für Bierliebhaber, gefüllt mit Pint-Slayern und Müsliliebhabern. Eine clevere Idee von David Béché, umgesetzt von Messe Basse Production! BeerCrackerz ist eine Open-Source-Website und mobile Anwendung, die unter der GPL-3.0-Lizenz veröffentlicht wird.",
"authProfileAboutVersion": "BeerCrackerz – v0.1.0 / BeerCrackerzMobile – v0.0.5",
"authProfileAboutVersion": "BeerCrackerz – v0.1.0 / BeerCrackerzMobile – v0.0.6",
"authProfileLogout": "Ausloggen",
"authProfileLogoutSuccessToastTitle": "Erfolgreiche Abmeldung",
"authProfileLogoutSuccessToastDescription": "Sie wurden erfolgreich von Ihrem Konto abgemeldet. Bis bald!",
Expand Down
2 changes: 1 addition & 1 deletion lib/src/localization/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
}
},
"authProfileAboutBeerCrackerz": "BeerCrackerz is the beer lovers comunity, filled with pint slayers and cereals lovers. A brilliant idea from David Béché, brought to life by Messe Basse Production! BeerCrackerz is an open source website and mobile application released under the GPL-3.0 licence.",
"authProfileAboutVersion": "BeerCrackerz – v0.1.0 / BeerCrackerzMobile – v0.0.5",
"authProfileAboutVersion": "BeerCrackerz – v0.1.0 / BeerCrackerzMobile – v0.0.6",
"authProfileLogout": "Logout",
"authProfileLogoutSuccessToastTitle": "Logout success",
"authProfileLogoutSuccessToastDescription": "You've been successfully logged out of your account. See you soon!",
Expand Down
2 changes: 1 addition & 1 deletion lib/src/localization/app_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
}
},
"authProfileAboutBeerCrackerz": "BeerCrackerz es la comunidad de amantes de la cerveza, llena de amantes de las pintas y de los cereales. ¡Una idea brillante de David Béché, materializada por Messe Basse Production! BeerCrackerz es un sitio web y una aplicación móvil de código abierto publicado bajo la licencia GPL-3.0.",
"authProfileAboutVersion": "BeerCrackerz – v0.1.0 / BeerCrackerzMobile – v0.0.5",
"authProfileAboutVersion": "BeerCrackerz – v0.1.0 / BeerCrackerzMobile – v0.0.6",
"authProfileLogout": "Cerrar sesión",
"authProfileLogoutSuccessToastTitle": "Cierre de sesión exitoso",
"authProfileLogoutSuccessToastDescription": "Has cerrado sesión exitosamente en tu cuenta. ¡Nos vemos pronto!",
Expand Down
2 changes: 1 addition & 1 deletion lib/src/localization/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
}
},
"authProfileAboutBeerCrackerz": "BeerCrackerz, c'est la communauté des amoureux de la Bière et du plein air, des pourfendeurs de pinte, des déglingos de la céréale. Une brilliante idée de David Béché, réalisée par Messe Basse Production! BeerCrackerz est un site et une application mobile en source libre, publiée sous licence GPL-3.0.",
"authProfileAboutVersion": "BeerCrackerz – v0.1.0 / BeerCrackerzMobile – v0.0.5",
"authProfileAboutVersion": "BeerCrackerz – v0.1.0 / BeerCrackerzMobile – v0.0.6",
"authProfileLogout": "Se déconnecter",
"authProfileLogoutSuccessToastTitle": "Déconnexion réussie",
"authProfileLogoutSuccessToastDescription": "Vous vous ète déconnecté de votre compte avec succès. À tantôt!",
Expand Down
2 changes: 1 addition & 1 deletion lib/src/localization/app_it.arb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
}
},
"authProfileAboutBeerCrackerz": "BeerCrackerz è la comunità degli amanti della birra, piena di cacciatori di pinte e amanti dei cereali. Un'idea brillante di David Béché, portata in vita da Messe Basse Production! BeerCrackerz è un sito Web open source e un'applicazione mobile rilasciata con licenza GPL-3.0.",
"authProfileAboutVersion": "BeerCrackerz – v0.1.0 / BeerCrackerzMobile – v0.0.5",
"authProfileAboutVersion": "BeerCrackerz – v0.1.0 / BeerCrackerzMobile – v0.0.6",
"authProfileLogout": "Disconnettersi",
"authProfileLogoutSuccessToastTitle": "Disconnessione riuscita",
"authProfileLogoutSuccessToastDescription": "Sei stato disconnesso con successo dal tuo account. Arrivederci!",
Expand Down
2 changes: 1 addition & 1 deletion lib/src/localization/app_pt.arb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
}
},
"authProfileAboutBeerCrackerz": "BeerCrackerz é a comunidade dos amantes da cerveja, repleta de caçadores de cerveja e amantes de cereais. Uma ideia brilhante de David Béché, concretizada pela Messe Basse Production! BeerCrackerz é um site de código aberto e um aplicativo móvel lançado sob a licença GPL-3.0.",
"authProfileAboutVersion": "BeerCrackerz – v0.1.0 / BeerCrackerzMobile – v0.0.5",
"authProfileAboutVersion": "BeerCrackerz – v0.1.0 / BeerCrackerzMobile – v0.0.6",
"authProfileLogout": "Sair",
"authProfileLogoutSuccessToastTitle": "Sucesso no logout",
"authProfileLogoutSuccessToastDescription": "Você foi desconectado da sua conta com sucesso. Vejo você em breve!",
Expand Down
6 changes: 5 additions & 1 deletion lib/src/settings/settings_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ class SettingsController with ChangeNotifier {
userId = parsedJson['id'];
username = parsedJson['username'];
email = parsedJson['email'];
ppPath = parsedJson['profilePicture'];
if (parsedJson['profilePicture'] == null) {
ppPath = 'assets/images/icon/profile.png';
} else {
ppPath = parsedJson['profilePicture'];
}
isUserActive = parsedJson['isActive'];
isUserStaff = parsedJson['isStaff'];
loggedIn = true;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: "The app for beer lovers, to share the best spot to crack a beer, o

publish_to: 'none'

version: 0.0.5+5
version: 0.0.6+6

environment:
sdk: '>=3.2.5 <4.0.0'
Expand Down

0 comments on commit 95614b6

Please sign in to comment.