From ac54fb2ab016d021c88ca57283c8e5077bd8e565 Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Fri, 19 Aug 2022 21:11:23 +0200 Subject: [PATCH] added new logo; improvements & bugfixes --- assets/logo.svg | 26 ++++++++++++++------- assets/logo_blank.svg | 11 --------- lib/constants/themes.dart | 9 +++++++ lib/locale/l10n/app_en.arb | 2 +- lib/screens/server_loading_screen.dart | 8 +++---- lib/widgets/help_sheet.dart | 9 ++++--- lib/widgets/help_sheet/help_sheet_form.dart | 7 +++++- lib/widgets/logo.dart | 9 +++---- 8 files changed, 46 insertions(+), 35 deletions(-) delete mode 100644 assets/logo_blank.svg diff --git a/assets/logo.svg b/assets/logo.svg index b8a8542..d14c591 100644 --- a/assets/logo.svg +++ b/assets/logo.svg @@ -1,12 +1,20 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/assets/logo_blank.svg b/assets/logo_blank.svg deleted file mode 100644 index 79a5577..0000000 --- a/assets/logo_blank.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/lib/constants/themes.dart b/lib/constants/themes.dart index 3742827..f5b7876 100644 --- a/lib/constants/themes.dart +++ b/lib/constants/themes.dart @@ -3,6 +3,10 @@ import 'package:flutter/material.dart'; import 'package:quid_faciam_hodie/constants/spacing.dart'; final LIGHT_THEME_MATERIAL = ThemeData( + colorScheme: ThemeData.light().colorScheme.copyWith( + primary: const Color(0xffd77422), + secondary: const Color(0xffcb4a1c), + ), textTheme: ThemeData().textTheme.copyWith( headline1: const TextStyle( fontSize: 32, @@ -20,6 +24,10 @@ final LIGHT_THEME_MATERIAL = ThemeData( ); final DARK_THEME_MATERIAL = ThemeData.dark().copyWith( + colorScheme: ThemeData.dark().colorScheme.copyWith( + primary: const Color(0xffd77422), + secondary: const Color(0xffcb4a1c), + ), textTheme: ThemeData.dark().textTheme.copyWith( headline1: const TextStyle( fontSize: 32, @@ -37,6 +45,7 @@ final DARK_THEME_MATERIAL = ThemeData.dark().copyWith( ); final LIGHT_THEME_CUPERTINO = CupertinoThemeData().copyWith( + primaryColor: const Color(0xffcb4a1c), textTheme: CupertinoThemeData().textTheme.copyWith( navLargeTitleTextStyle: const TextStyle( fontSize: 32, diff --git a/lib/locale/l10n/app_en.arb b/lib/locale/l10n/app_en.arb index 595645a..6705f02 100644 --- a/lib/locale/l10n/app_en.arb +++ b/lib/locale/l10n/app_en.arb @@ -136,7 +136,7 @@ "emptyScreenTitle": "Houston, we have a problem", - "emptyScreenSubtitle": "The user hasn't created any memories yet!", + "emptyScreenSubtitle": "The user hasn't created any mem ories yet!", "emptyScreenDescription": "To view your timeline you need to create some memories first! :)", "emptyScreenCreateMemory": "Create a Memory", diff --git a/lib/screens/server_loading_screen.dart b/lib/screens/server_loading_screen.dart index 76728b1..0ffbc17 100644 --- a/lib/screens/server_loading_screen.dart +++ b/lib/screens/server_loading_screen.dart @@ -41,7 +41,10 @@ class _ServerLoadingScreenState extends State { } Future load() async { - if (widget.isInitialLoading) { + await GlobalValuesManager.waitForInitialization(); + final session = Supabase.instance.client.auth.session(); + + if (widget.isInitialLoading && session == null) { await Navigator.pushNamed( context, WelcomeScreen.ID, @@ -58,10 +61,7 @@ class _ServerLoadingScreenState extends State { } } - await GlobalValuesManager.waitForInitialization(); - final memories = context.read(); - final session = Supabase.instance.client.auth.session(); if (session == null && widget.nextScreen == LoginScreen.ID) { Navigator.pushReplacementNamed( diff --git a/lib/widgets/help_sheet.dart b/lib/widgets/help_sheet.dart index 3bcb160..a4ab296 100644 --- a/lib/widgets/help_sheet.dart +++ b/lib/widgets/help_sheet.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; @@ -49,7 +51,7 @@ class _HelpSheetState extends State { return; } - WidgetsBinding.instance.addPostFrameCallback((_) async { + Timer(Duration(milliseconds: 300), () async { if (!mounted) { return; } @@ -109,8 +111,9 @@ class _HelpSheetState extends State { @override Widget build(BuildContext context) { return AnimatedScale( - scale: isShowingSheet ? .99 : 1, - duration: const Duration(milliseconds: 200), + scale: isShowingSheet ? .95 : 1, + curve: Curves.easeOutSine, + duration: const Duration(milliseconds: 500), child: widget.child, ); } diff --git a/lib/widgets/help_sheet/help_sheet_form.dart b/lib/widgets/help_sheet/help_sheet_form.dart index f89ff7f..3c4e817 100644 --- a/lib/widgets/help_sheet/help_sheet_form.dart +++ b/lib/widgets/help_sheet/help_sheet_form.dart @@ -41,12 +41,17 @@ class _HelpSheetFormState extends State { child: Text(localizations.generalUnderstoodButtonLabel), onPressed: () => Navigator.pop(context, dontShowSheetAgain), ), - const SizedBox(height: MEDIUM_SPACE), + const SizedBox(height: SMALL_SPACE), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ PlatformSwitch( value: dontShowSheetAgain, + activeColor: platformThemeData( + context, + material: (data) => data.colorScheme.primary, + cupertino: (data) => data.primaryColor, + ), onChanged: (value) { setState(() { dontShowSheetAgain = value; diff --git a/lib/widgets/logo.dart b/lib/widgets/logo.dart index 3f66feb..fd2ba83 100644 --- a/lib/widgets/logo.dart +++ b/lib/widgets/logo.dart @@ -21,12 +21,9 @@ class Logo extends StatelessWidget { ), ], ), - child: Padding( - padding: const EdgeInsets.all(SPACE_MULTIPLIER * 15), - child: SvgPicture.asset( - 'assets/logo_blank.svg', - width: 100, - ), + child: SvgPicture.asset( + 'assets/logo.svg', + width: 150, ), ); }