improvements & bugfixes

This commit is contained in:
Myzel394 2022-08-21 19:45:09 +02:00
parent 4f54e54bba
commit b9e4d29fa1
10 changed files with 119 additions and 85 deletions

View File

@ -6,6 +6,7 @@
"generalContinueButtonLabel": "Weiter", "generalContinueButtonLabel": "Weiter",
"generalUnderstoodButtonLabel": "OK", "generalUnderstoodButtonLabel": "OK",
"generalLoadingLabel": "Wird geladen...", "generalLoadingLabel": "Wird geladen...",
"generalSwipeForMore": "Wische hoch für mehr",
"welcomeScreenDescription": "Finde heraus was du den ganzen Tag gemacht hast und erlebe Erinnerungen wieder, die du komplett vergessen hast!", "welcomeScreenDescription": "Finde heraus was du den ganzen Tag gemacht hast und erlebe Erinnerungen wieder, die du komplett vergessen hast!",
"welcomeScreenSubtitle": "Was hab ich heute gemacht?", "welcomeScreenSubtitle": "Was hab ich heute gemacht?",
@ -41,6 +42,9 @@
"loginScreenFormPasswordLabel": "Passwort", "loginScreenFormPasswordLabel": "Passwort",
"loginScreenFormSubmitButton": "Anmelden", "loginScreenFormSubmitButton": "Anmelden",
"loginScreenLoginFailed": "E-Mail oder Passwort inkorrekt", "loginScreenLoginFailed": "E-Mail oder Passwort inkorrekt",
"loginScreenSignUpDialogTitle": "Registrieren",
"loginScreenSignUpDialogExplanation": "Wir haben deinen Account nicht gefunden. Möchtest du dich jetzt registrieren?",
"loginScreenSignUpDialogAffirmationLabel": "Jetzt registrieren",
"grantPermissionScreenTitle": "Berechtigungen erteilen", "grantPermissionScreenTitle": "Berechtigungen erteilen",
@ -71,7 +75,6 @@
"memoryMapScreenTitle": "Standort", "memoryMapScreenTitle": "Standort",
"memoryMapScreenExpandForMoreDescription": "Erweitere für mehr Details",
"memoryMapScreenOpenNavigation": "Navigation öffnen", "memoryMapScreenOpenNavigation": "Navigation öffnen",
"memoryMapScreenValuesAddressLabel": "Geschätzte Adresse", "memoryMapScreenValuesAddressLabel": "Geschätzte Adresse",
"memoryMapScreenValuesAddressIsUnavailable": "Address nicht verfügbar", "memoryMapScreenValuesAddressIsUnavailable": "Address nicht verfügbar",

View File

@ -7,6 +7,7 @@
"generalSaveButtonLabel": "Save", "generalSaveButtonLabel": "Save",
"generalUnderstoodButtonLabel": "OK", "generalUnderstoodButtonLabel": "OK",
"generalLoadingLabel": "Loading...", "generalLoadingLabel": "Loading...",
"generalSwipeForMore": "Swipe up for more",
"welcomeScreenDescription": "Find out what you did all the days and unlock moments you completely forgot!", "welcomeScreenDescription": "Find out what you did all the days and unlock moments you completely forgot!",
"welcomeScreenSubtitle": "What did I do today?", "welcomeScreenSubtitle": "What did I do today?",
@ -66,6 +67,9 @@
"loginScreenFormPasswordLabel": "Password", "loginScreenFormPasswordLabel": "Password",
"loginScreenFormSubmitButton": "Login", "loginScreenFormSubmitButton": "Login",
"loginScreenLoginFailed": "Email or password incorrect", "loginScreenLoginFailed": "Email or password incorrect",
"loginScreenSignUpDialogTitle": "Sign up",
"loginScreenSignUpDialogExplanation": "We didn't find your account. Do you want to sign up now?",
"loginScreenSignUpDialogAffirmationLabel": "Sign me up now",
"grantPermissionScreenTitle": "Grant Permissions", "grantPermissionScreenTitle": "Grant Permissions",
@ -105,7 +109,6 @@
"memoryMapScreenTitle": "Location", "memoryMapScreenTitle": "Location",
"memoryMapScreenExpandForMoreDescription": "Expand for more details",
"memoryMapScreenOpenNavigation": "Open Navigation", "memoryMapScreenOpenNavigation": "Open Navigation",
"memoryMapScreenValuesAddressLabel": "Estimated Address", "memoryMapScreenValuesAddressLabel": "Estimated Address",
"memoryMapScreenValuesAddressIsUnavailable": "Address not available", "memoryMapScreenValuesAddressIsUnavailable": "Address not available",

View File

@ -72,12 +72,35 @@ class _LoginScreenState extends AuthState<LoginScreen> with Loadable {
} }
} }
Future<bool> _askWhetherToSignUp() {
final localizations = AppLocalizations.of(context)!;
return showPlatformDialog(
context: context,
builder: (_) => PlatformAlertDialog(
title: Text(localizations.loginScreenSignUpDialogTitle),
content: Text(localizations.loginScreenSignUpDialogExplanation),
actions: <Widget>[
PlatformDialogAction(
child: Text(localizations.generalCancelButtonLabel),
onPressed: () => Navigator.pop(context, false),
),
PlatformDialogAction(
child: Text(localizations.loginScreenSignUpDialogAffirmationLabel),
onPressed: () => Navigator.pop(context, true),
),
],
),
) as Future<bool>;
}
Future<void> signIn() async { Future<void> signIn() async {
final localizations = AppLocalizations.of(context)!; final localizations = AppLocalizations.of(context)!;
try { try {
await _signIn(); await _signIn();
} catch (error) { } catch (error) {
if (await _askWhetherToSignUp()) {
try { try {
await _signUp(); await _signUp();
} catch (error) { } catch (error) {
@ -91,6 +114,7 @@ class _LoginScreenState extends AuthState<LoginScreen> with Loadable {
return; return;
} }
} }
}
if (mounted) { if (mounted) {
Navigator.push( Navigator.push(

View File

@ -158,7 +158,10 @@ class _MainScreenState extends AuthRequiredState<MainScreen> with Loadable {
settings.resolution, settings.resolution,
imageFormatGroup: ImageFormatGroup.jpeg, imageFormatGroup: ImageFormatGroup.jpeg,
); );
try {
cameraController.setFlashMode(FlashMode.off); cameraController.setFlashMode(FlashMode.off);
} catch (error) {}
await previousCameraController?.dispose(); await previousCameraController?.dispose();

View File

@ -98,7 +98,7 @@ class _MemoryMapScreenState extends State<MemoryMapScreen> with Loadable {
const SheetIndicator(), const SheetIndicator(),
const SizedBox(height: MEDIUM_SPACE), const SizedBox(height: MEDIUM_SPACE),
Text( Text(
localizations.memoryMapScreenExpandForMoreDescription, localizations.generalSwipeForMore,
style: getBodyTextTextStyle(context), style: getBodyTextTextStyle(context),
), ),
], ],

View File

@ -237,6 +237,13 @@ class _MemorySheetState extends State<MemorySheet> with Loadable {
), ),
], ],
), ),
if (widget.memory.location != null) ...[
const SizedBox(height: SMALL_SPACE),
Text(
localizations.generalSwipeForMore,
style: getBodyTextTextStyle(context),
),
],
], ],
), ),
), ),

View File

@ -67,9 +67,7 @@ class _PhotoSwitchingState extends State<PhotoSwitching> {
final nextImage = NetworkImage(nextPhotoURL); final nextImage = NetworkImage(nextPhotoURL);
precacheImage(nextImage, context); precacheImage(nextImage, context);
setState(() {
images.add(nextImage); images.add(nextImage);
});
} }
Future<void> getNextPhoto() async { Future<void> getNextPhoto() async {

View File

@ -108,7 +108,7 @@ class _HelpSheetState extends State<HelpSheet> {
}); });
} }
if (dontShowSheetAgain) { if (dontShowSheetAgain == true) {
await UserHelpSheetsManager.setAsShown(widget.helpID); await UserHelpSheetsManager.setAsShown(widget.helpID);
} }
}); });

View File

@ -27,7 +27,6 @@ class _HelpSheetFormState extends State<HelpSheetForm> {
final localizations = AppLocalizations.of(context)!; final localizations = AppLocalizations.of(context)!;
return ModalSheet( return ModalSheet(
child: SingleChildScrollView(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Text( Text(
@ -68,7 +67,6 @@ class _HelpSheetFormState extends State<HelpSheetForm> {
), ),
], ],
), ),
),
); );
} }
} }

View File

@ -14,12 +14,9 @@ class ModalSheet extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final innerChild = Padding( return SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: MEDIUM_SPACE), padding: const EdgeInsets.symmetric(vertical: MEDIUM_SPACE),
child: child, child: Column(
);
return Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
PlatformWidget( PlatformWidget(
@ -32,7 +29,7 @@ class ModalSheet extends StatelessWidget {
color: getSheetColor(context), color: getSheetColor(context),
), ),
padding: const EdgeInsets.symmetric(vertical: LARGE_SPACE), padding: const EdgeInsets.symmetric(vertical: LARGE_SPACE),
child: innerChild, child: child,
), ),
cupertino: (_, __) => CupertinoPopupSurface( cupertino: (_, __) => CupertinoPopupSurface(
isSurfacePainted: false, isSurfacePainted: false,
@ -40,12 +37,13 @@ class ModalSheet extends StatelessWidget {
color: Colors.white, color: Colors.white,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: LARGE_SPACE), padding: const EdgeInsets.symmetric(vertical: LARGE_SPACE),
child: innerChild, child: child,
), ),
), ),
), ),
) )
], ],
),
); );
} }
} }