From 3ae6806b38a257b11f53442a87462546f9b65b39 Mon Sep 17 00:00:00 2001 From: Shawn Date: Tue, 6 Sep 2022 09:39:01 -0600 Subject: [PATCH 01/15] Tweak layout for home page. Add title, remove page indicator, reduce bottom padding --- lib/styles/styles.dart | 3 + .../diagonal_text_page_indicator.dart | 9 +- .../editorial/widgets/_title_text.dart | 15 ++- lib/ui/screens/home/wonders_home_screen.dart | 110 ++++++++++-------- .../common/wonder_title_text.dart | 15 ++- 5 files changed, 89 insertions(+), 63 deletions(-) diff --git a/lib/styles/styles.dart b/lib/styles/styles.dart index caf64d58..966452b0 100644 --- a/lib/styles/styles.dart +++ b/lib/styles/styles.dart @@ -134,6 +134,9 @@ class _Insets { @immutable class _Shadows { + final textSoft = [ + Shadow(color: Colors.black.withOpacity(.25), offset: Offset(0, 2), blurRadius: 4), + ]; final text = [ Shadow(color: Colors.black.withOpacity(.6), offset: Offset(0, 2), blurRadius: 2), ]; diff --git a/lib/ui/common/controls/diagonal_text_page_indicator.dart b/lib/ui/common/controls/diagonal_text_page_indicator.dart index 2d480fe2..4d62d346 100644 --- a/lib/ui/common/controls/diagonal_text_page_indicator.dart +++ b/lib/ui/common/controls/diagonal_text_page_indicator.dart @@ -5,7 +5,7 @@ class DiagonalTextPageIndicator extends StatelessWidget { const DiagonalTextPageIndicator({Key? key, required this.current, required this.total}) : super(key: key); final int current; final int total; - static const double _fontSize = 32; + static const double _fontSize = 26; @override Widget build(BuildContext context) { @@ -21,10 +21,7 @@ class DiagonalTextPageIndicator extends StatelessWidget { child: Transform.translate( offset: Offset(-_fontSize * .7, 0), child: SizedBox( - width: size, - height: size, - child: Text('0$current', - style: textStyle.copyWith(shadows: $styles.shadows.text), textAlign: TextAlign.right)), + width: size, height: size, child: Text('0$current', style: textStyle, textAlign: TextAlign.right)), ), ), ClipPath( @@ -38,7 +35,7 @@ class DiagonalTextPageIndicator extends StatelessWidget { opacity: .5, child: Text( '0$total', - style: textStyle.copyWith(shadows: $styles.shadows.textStrong), + style: textStyle, //.copyWith(shadows: $styles.shadows.textStrong), ), ), ), diff --git a/lib/ui/screens/editorial/widgets/_title_text.dart b/lib/ui/screens/editorial/widgets/_title_text.dart index 69886906..948834a3 100644 --- a/lib/ui/screens/editorial/widgets/_title_text.dart +++ b/lib/ui/screens/editorial/widgets/_title_text.dart @@ -14,6 +14,8 @@ class _TitleText extends StatelessWidget { children: [ Gap($styles.insets.md), Gap(30), + + /// Sub-title row SeparatedRow( padding: EdgeInsets.symmetric(horizontal: $styles.insets.sm), separatorBuilder: () => Gap($styles.insets.sm), @@ -39,14 +41,23 @@ class _TitleText extends StatelessWidget { ], ), Gap($styles.insets.md), - Semantics(sortKey: OrdinalSortKey(0), child: WonderTitleText(data)), + + /// Wonder title text + Semantics( + sortKey: OrdinalSortKey(0), + child: WonderTitleText(data), + ), Gap($styles.insets.xs), + + /// Region Text( data.regionTitle.toUpperCase(), style: $styles.text.title1, textAlign: TextAlign.center, ), Gap($styles.insets.md), + + /// Compass divider ExcludeSemantics( child: Padding( padding: EdgeInsets.symmetric(horizontal: $styles.insets.md), @@ -61,6 +72,8 @@ class _TitleText extends StatelessWidget { ), ), Gap($styles.insets.sm), + + /// Date Text( StringUtils.supplant( $strings.titleLabelDate, diff --git a/lib/ui/screens/home/wonders_home_screen.dart b/lib/ui/screens/home/wonders_home_screen.dart index 06861261..a4cd9f58 100644 --- a/lib/ui/screens/home/wonders_home_screen.dart +++ b/lib/ui/screens/home/wonders_home_screen.dart @@ -12,6 +12,7 @@ import 'package:wonders/ui/screens/home_menu/home_menu.dart'; import 'package:wonders/ui/wonder_illustrations/common/animated_clouds.dart'; import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration.dart'; import 'package:wonders/ui/wonder_illustrations/common/wonder_illustration_config.dart'; +import 'package:wonders/ui/wonder_illustrations/common/wonder_title_text.dart'; part '_vertical_swipe_controller.dart'; part 'widgets/_animated_arrow_button.dart'; @@ -143,7 +144,7 @@ class _HomeScreenState extends State with SingleTickerProviderStateM Stack(children: [ /// Foreground gradient-1, gets darker when swiping up BottomCenter( - child: _buildSwipeableBgGradient(currentWonder.type.bgColor.withOpacity(.5)), + child: _buildSwipeableBgGradient(currentWonder.type.bgColor.withOpacity(.65)), ), /// Foreground decorators @@ -151,69 +152,78 @@ class _HomeScreenState extends State with SingleTickerProviderStateM /// Foreground gradient-2, gets darker when swiping up BottomCenter( - child: _buildSwipeableBgGradient(currentWonder.type.bgColor.withOpacity(.5)), + child: _buildSwipeableBgGradient(currentWonder.type.bgColor.withOpacity(1)), ), /// Floating controls / UI AnimatedSwitcher( duration: $styles.times.fast, child: RepaintBoundary( - child: OverflowBox( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - SizedBox(width: double.infinity), - const Spacer(), + key: ObjectKey(currentWonder), + child: IgnorePointer( + ignoringSemantics: false, + child: OverflowBox( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox(width: double.infinity), + const Spacer(), - /// Title Content - LightText( - child: MergeSemantics( - child: Column( - children: [ - /// Page indicator - IgnorePointer( - child: DiagonalTextPageIndicator(current: _wonderIndex + 1, total: _numWonders), - ), - Gap($styles.insets.sm), + /// Title Content + LightText( + child: MergeSemantics( + child: Transform.translate( + offset: Offset(0, 30), + child: Column( + children: [ + WonderTitleText(currentWonder, enableShadows: true), - AppPageIndicator( - count: _numWonders, - controller: _pageController, - color: $styles.colors.white, - dotSize: 8, - onDotPressed: _handlePageIndicatorDotPressed, - semanticPageTitle: $strings.homeSemanticWonder, + //Gap($styles.insets.sm), + AppPageIndicator( + count: _numWonders, + controller: _pageController, + color: $styles.colors.white, + dotSize: 8, + onDotPressed: _handlePageIndicatorDotPressed, + semanticPageTitle: $strings.homeSemanticWonder, + ), + + /// Page indicator + // IgnorePointer( + // child: DiagonalTextPageIndicator(current: _wonderIndex + 1, total: _numWonders), + // ), + ], ), - ], + ), ), ), - ), - Gap($styles.insets.xs), + //Gap($styles.insets.xs), - /// Animated arrow and background - /// Wrap in a container that is full-width to make it easier to find for screen readers - MergeSemantics( - child: Container( - width: double.infinity, - alignment: Alignment.center, + /// Animated arrow and background + /// Wrap in a container that is full-width to make it easier to find for screen readers + MergeSemantics( + child: Container( + width: double.infinity, + alignment: Alignment.center, - /// Lose state of child objects when index changes, this will re-run all the animated switcher and the arrow anim - key: ValueKey(_wonderIndex), - child: Stack( - children: [ - /// Expanding rounded rect that grows in height as user swipes up - Positioned.fill( - child: _buildSwipeableArrowBg(), - ), + /// Lose state of child objects when index changes, this will re-run all the animated switcher and the arrow anim + key: ValueKey(_wonderIndex), + child: Stack( + children: [ + /// Expanding rounded rect that grows in height as user swipes up + Positioned.fill( + child: _buildSwipeableArrowBg(), + ), - /// Arrow Btn that fades in and out - _AnimatedArrowButton(onTap: _showDetailsPage, semanticTitle: currentWonder.title), - ], + /// Arrow Btn that fades in and out + _AnimatedArrowButton(onTap: _showDetailsPage, semanticTitle: currentWonder.title), + ], + ), ), ), - ), - Gap($styles.insets.md), - ], + Gap($styles.insets.md), + ], + ), ), ), ), @@ -306,7 +316,7 @@ class _HomeScreenState extends State with SingleTickerProviderStateM return _swipeController.buildListener(builder: (swipeAmt, isPointerDown, _) { return IgnorePointer( child: FractionallySizedBox( - heightFactor: .5, + heightFactor: .6, child: Container( decoration: BoxDecoration( gradient: LinearGradient( @@ -314,7 +324,7 @@ class _HomeScreenState extends State with SingleTickerProviderStateM end: Alignment.bottomCenter, colors: [ fgColor.withOpacity(0), - fgColor.withOpacity(fgColor.opacity * .75 + (isPointerDown ? .05 : 0) + swipeAmt * .20), + fgColor.withOpacity(.5 + fgColor.opacity * .25 + (isPointerDown ? .05 : 0) + swipeAmt * .20), ], stops: const [0, 1], ), diff --git a/lib/ui/wonder_illustrations/common/wonder_title_text.dart b/lib/ui/wonder_illustrations/common/wonder_title_text.dart index e07e796f..6737cdd6 100644 --- a/lib/ui/wonder_illustrations/common/wonder_title_text.dart +++ b/lib/ui/wonder_illustrations/common/wonder_title_text.dart @@ -40,12 +40,15 @@ class WonderTitleText extends StatelessWidget { ); } - List shadows = enableShadows ? $styles.shadows.text : []; - return RichText( - textAlign: TextAlign.center, - text: TextSpan( - style: textStyle.copyWith(shadows: shadows), - children: pieces.map(buildTextSpan).toList(), + List shadows = enableShadows ? $styles.shadows.textSoft : []; + return Hero( + tag: 'wonderTitle-$title', + child: RichText( + textAlign: TextAlign.center, + text: TextSpan( + style: textStyle.copyWith(shadows: shadows), + children: pieces.map(buildTextSpan).toList(), + ), ), ); } From 466fe074b8be70855bd747e87450a73c06bc0d38 Mon Sep 17 00:00:00 2001 From: Eddie Date: Thu, 1 Sep 2022 14:45:55 -0600 Subject: [PATCH 02/15] Initial stab at swapping locales, work in progress - stubbed in button for testing locale switching, needs design polish and direction on whether the button is available at all times or just in menu - tested and fixed switching on the fly for wonder views, intro, timeline, artifacts, and menu --- lib/l10n/app_en.arb | 1 + lib/l10n/app_zh.arb | 1 + lib/logic/app_logic.dart | 5 ++- lib/logic/locale_logic.dart | 8 ++++ lib/logic/settings_logic.dart | 1 + lib/logic/timeline_logic.dart | 17 ++++---- lib/logic/wonders_logic.dart | 24 ++++++----- lib/main.dart | 32 +++++++++------ lib/ui/app_scaffold.dart | 27 +++++++++++++ lib/ui/screens/home_menu/home_menu.dart | 54 +++++++++++++------------ lib/ui/screens/intro/intro_screen.dart | 13 +++--- 11 files changed, 120 insertions(+), 63 deletions(-) diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 59babdcc..697bedf8 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -1,5 +1,6 @@ { "appName": "Wonderous", + "localeSwapButton": "简体中文", "animatedArrowSemanticSwipe": "Explore details about {title}.", "appBarTitleFactsHistory": "Facts and History", "appBarTitleConstruction": "Construction", diff --git a/lib/l10n/app_zh.arb b/lib/l10n/app_zh.arb index b3e8fd0e..31ac6c93 100644 --- a/lib/l10n/app_zh.arb +++ b/lib/l10n/app_zh.arb @@ -1,5 +1,6 @@ { "appName": "Wonderous", + "localeSwapButton": "English", "animatedArrowSemanticSwipe": "查看关于{title}的详细信息。", "appBarTitleFactsHistory": "历史与细节", "appBarTitleConstruction": "建造", diff --git a/lib/logic/app_logic.dart b/lib/logic/app_logic.dart index b1fd3e6f..1bc93ce3 100644 --- a/lib/logic/app_logic.dart +++ b/lib/logic/app_logic.dart @@ -30,8 +30,11 @@ class AppLogic { // Localizations await localeLogic.load(); + // Data load + wondersLogic.init(); + // Timeline - await timelineLogic.init(); + timelineLogic.init(); // Settings await settingsLogic.load(); diff --git a/lib/logic/locale_logic.dart b/lib/logic/locale_logic.dart index 9067fda9..ebbe61f4 100644 --- a/lib/logic/locale_logic.dart +++ b/lib/logic/locale_logic.dart @@ -3,6 +3,7 @@ import 'dart:ui'; import 'package:flutter/foundation.dart'; import 'package:intl/intl_standalone.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:wonders/common_libs.dart'; class LocaleLogic { AppLocalizations? _strings; @@ -20,6 +21,13 @@ class LocaleLogic { if (AppLocalizations.supportedLocales.contains(locale) == false) { locale = Locale('en'); } + settingsLogic.currentLocale.value = locale.languageCode; _strings = await AppLocalizations.delegate.load(locale); } + + Future refreshIfChanged(Locale locale) async { + if (_strings?.localeName != locale.languageCode && AppLocalizations.supportedLocales.contains(locale)) { + _strings = await AppLocalizations.delegate.load(locale); + } + } } diff --git a/lib/logic/settings_logic.dart b/lib/logic/settings_logic.dart index 451a1111..3a09ae84 100644 --- a/lib/logic/settings_logic.dart +++ b/lib/logic/settings_logic.dart @@ -7,6 +7,7 @@ class SettingsLogic with ThrottledSaveLoadMixin { late final hasCompletedOnboarding = ValueNotifier(false)..addListener(scheduleSave); late final hasDismissedSearchMessage = ValueNotifier(false)..addListener(scheduleSave); + late final currentLocale = ValueNotifier('en')..addListener(scheduleSave); final bool useBlurs = defaultTargetPlatform != TargetPlatform.android; diff --git a/lib/logic/timeline_logic.dart b/lib/logic/timeline_logic.dart index 32dc2995..8e1e6808 100644 --- a/lib/logic/timeline_logic.dart +++ b/lib/logic/timeline_logic.dart @@ -3,18 +3,17 @@ import 'package:wonders/logic/common/string_utils.dart'; import 'package:wonders/logic/data/timeline_data.dart'; class TimelineLogic { - final List events = []; + List events = []; - Future init() async { - events.addAll(GlobalEventsData().globalEvents); - - for (var w in wondersLogic.all) { - events.add( - TimelineEvent( + void init() { + events = [ + ...GlobalEventsData().globalEvents, + ...wondersLogic.all.map( + (w) => TimelineEvent( w.startYr, StringUtils.supplant($strings.timelineLabelConstruction, {'{title}': w.title}), ), - ); - } + ) + ]; } } diff --git a/lib/logic/wonders_logic.dart b/lib/logic/wonders_logic.dart index 34362286..f84481c8 100644 --- a/lib/logic/wonders_logic.dart +++ b/lib/logic/wonders_logic.dart @@ -10,16 +10,7 @@ import 'package:wonders/logic/data/wonders_data/pyramids_giza_data.dart'; import 'package:wonders/logic/data/wonders_data/taj_mahal_data.dart'; class WondersLogic { - late List all = [ - GreatWallData(), - PetraData(), - ColosseumData(), - ChichenItzaData(), - MachuPicchuData(), - TajMahalData(), - ChristRedeemerData(), - PyramidsGizaData(), - ]; + List all = []; final int timelineStartYear = -3000; final int timelineEndYear = 2200; @@ -29,4 +20,17 @@ class WondersLogic { if (result == null) throw ('Could not find data for wonder type $value'); return result; } + + void init() { + all = [ + GreatWallData(), + PetraData(), + ColosseumData(), + ChichenItzaData(), + MachuPicchuData(), + TajMahalData(), + ChristRedeemerData(), + PyramidsGizaData(), + ]; + } } diff --git a/lib/main.dart b/lib/main.dart index fed31757..4b08f62e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -30,19 +30,25 @@ class WondersApp extends StatelessWidget { const WondersApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { - return MaterialApp.router( - debugShowCheckedModeBanner: false, - routerDelegate: appRouter.routerDelegate, - routeInformationProvider: appRouter.routeInformationProvider, - routeInformationParser: appRouter.routeInformationParser, - theme: ThemeData(fontFamily: $styles.text.body.fontFamily), - localizationsDelegates: const [ - AppLocalizations.delegate, - GlobalMaterialLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - GlobalCupertinoLocalizations.delegate, - ], - supportedLocales: AppLocalizations.supportedLocales, + return ValueListenableBuilder( + valueListenable: settingsLogic.currentLocale, + builder: (_, localeCode, __) { + return MaterialApp.router( + locale: Locale(localeCode), + debugShowCheckedModeBanner: false, + routerDelegate: appRouter.routerDelegate, + routeInformationProvider: appRouter.routeInformationProvider, + routeInformationParser: appRouter.routeInformationParser, + theme: ThemeData(fontFamily: $styles.text.body.fontFamily), + localizationsDelegates: const [ + AppLocalizations.delegate, + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + ], + supportedLocales: AppLocalizations.supportedLocales, + ); + } ); } } diff --git a/lib/ui/app_scaffold.dart b/lib/ui/app_scaffold.dart index 9824c777..32241cd5 100644 --- a/lib/ui/app_scaffold.dart +++ b/lib/ui/app_scaffold.dart @@ -5,6 +5,15 @@ class WondersAppScaffold extends StatelessWidget with GetItMixin { WondersAppScaffold({Key? key, required this.child}) : super(key: key); final Widget child; + Future _handleSwapLocale() async { + final currentLocale = settingsLogic.currentLocale.value; + final newLocale = Locale(currentLocale == 'en' ? 'zh' : 'en'); + settingsLogic.currentLocale.value = newLocale.languageCode; + await localeLogic.refreshIfChanged(newLocale); + wondersLogic.init(); + timelineLogic.init(); + } + @override Widget build(BuildContext context) { Animate.defaultDuration = $styles.times.fast; @@ -22,6 +31,24 @@ class WondersAppScaffold extends StatelessWidget with GetItMixin { ), ), ), + + //TODO: just some test UI to check swapping behavior, need to get finalized design and location + Align( + alignment: Alignment.topRight, + child: SafeArea( + child: TextButton( + onPressed: _handleSwapLocale, + child: Container( + decoration: BoxDecoration( + color: $styles.colors.greyStrong.withOpacity(.7), + borderRadius: BorderRadius.all(Radius.circular($styles.corners.md)), + ), + padding: EdgeInsets.all($styles.insets.sm), + child: Text($strings.localeSwapButton, style: $styles.text.btn.copyWith(color: $styles.colors.white)), + ), + ), + ), + ), ], ); } diff --git a/lib/ui/screens/home_menu/home_menu.dart b/lib/ui/screens/home_menu/home_menu.dart index 6b023cdf..99ffbe1a 100644 --- a/lib/ui/screens/home_menu/home_menu.dart +++ b/lib/ui/screens/home_menu/home_menu.dart @@ -106,31 +106,35 @@ class HomeMenu extends StatelessWidget { } Widget _buildBottomBtns(BuildContext context) { - return SeparatedColumn( - separatorBuilder: () => Divider(thickness: 1.5, height: 1).animate().scale( - duration: $styles.times.slow, - delay: $styles.times.pageTransition + 200.ms, - curve: Curves.easeOutBack, - ), - children: [ - _MenuTextBtn( - label: $strings.homeMenuButtonExplore, - icon: AppIcons.timeline, - onPressed: () => _handleTimelinePressed(context)), - _MenuTextBtn( - label: $strings.homeMenuButtonView, - icon: AppIcons.collection, - onPressed: () => _handleCollectionPressed(context)), - _MenuTextBtn( - label: $strings.homeMenuButtonAbout, - icon: AppIcons.info, - onPressed: () => _handleAboutPressed(context), - ), - ] - .animate(interval: 50.ms) - .fade(delay: $styles.times.pageTransition + 50.ms) - .slide(begin: Offset(0, .1), curve: Curves.easeOut), - ); + return ValueListenableBuilder( + valueListenable: settingsLogic.currentLocale, + builder: (_, __, ___) { + return SeparatedColumn( + separatorBuilder: () => Divider(thickness: 1.5, height: 1).animate().scale( + duration: $styles.times.slow, + delay: $styles.times.pageTransition + 200.ms, + curve: Curves.easeOutBack, + ), + children: [ + _MenuTextBtn( + label: $strings.homeMenuButtonExplore, + icon: AppIcons.timeline, + onPressed: () => _handleTimelinePressed(context)), + _MenuTextBtn( + label: $strings.homeMenuButtonView, + icon: AppIcons.collection, + onPressed: () => _handleCollectionPressed(context)), + _MenuTextBtn( + label: $strings.homeMenuButtonAbout, + icon: AppIcons.info, + onPressed: () => _handleAboutPressed(context), + ), + ] + .animate(interval: 50.ms) + .fade(delay: $styles.times.pageTransition + 50.ms) + .slide(begin: Offset(0, .1), curve: Curves.easeOut), + ); + }); } Widget _buildGridBtn(BuildContext context, WonderData btnData) { diff --git a/lib/ui/screens/intro/intro_screen.dart b/lib/ui/screens/intro/intro_screen.dart index 37955fef..d0afe413 100644 --- a/lib/ui/screens/intro/intro_screen.dart +++ b/lib/ui/screens/intro/intro_screen.dart @@ -19,11 +19,7 @@ class _IntroScreenState extends State { static const double _textHeight = 155; static const double _pageIndicatorHeight = 55; - static List<_PageData> pageData = [ - _PageData($strings.introTitleJourney, $strings.introDescriptionNavigate, 'camel', '1'), - _PageData($strings.introTitleExplore, $strings.introDescriptionUncover, 'petra', '2'), - _PageData($strings.introTitleDiscover, $strings.introDescriptionLearn, 'statue', '3'), - ]; + static List<_PageData> pageData = []; late final PageController _pageController = PageController()..addListener(_handlePageChanged); final ValueNotifier _currentPage = ValueNotifier(0); @@ -51,6 +47,13 @@ class _IntroScreenState extends State { @override Widget build(BuildContext context) { + // Set the page data, as strings may have changed based on locale + pageData = [ + _PageData($strings.introTitleJourney, $strings.introDescriptionNavigate, 'camel', '1'), + _PageData($strings.introTitleExplore, $strings.introDescriptionUncover, 'petra', '2'), + _PageData($strings.introTitleDiscover, $strings.introDescriptionLearn, 'statue', '3'), + ]; + // This view uses a full screen PageView to enable swipe navigation. // However, we only want the title / description to actually swipe, // so we stack a PageView with that content over top of all the other From 726cc6d5e73900f83b5a21a409de3b59ea117479 Mon Sep 17 00:00:00 2001 From: Eddie Date: Tue, 6 Sep 2022 16:31:22 -0600 Subject: [PATCH 03/15] Add Locale button - add LocaleButton to intro and menu, toasted placeholder in app_scaffold - add localeLogic.isEnglish helper, used in _results_grid and _scrolling_content --- lib/logic/locale_logic.dart | 2 ++ lib/ui/app_scaffold.dart | 27 ---------------- lib/ui/common/controls/locale_button.dart | 32 +++++++++++++++++++ .../widgets/_results_grid.dart | 3 +- .../editorial/widgets/_scrolling_content.dart | 3 +- lib/ui/screens/home_menu/home_menu.dart | 13 +++++++- lib/ui/screens/intro/intro_screen.dart | 7 ++++ 7 files changed, 55 insertions(+), 32 deletions(-) create mode 100644 lib/ui/common/controls/locale_button.dart diff --git a/lib/logic/locale_logic.dart b/lib/logic/locale_logic.dart index ebbe61f4..414d6f30 100644 --- a/lib/logic/locale_logic.dart +++ b/lib/logic/locale_logic.dart @@ -11,6 +11,8 @@ class LocaleLogic { bool get isLoaded => _strings != null; + bool get isEnglish => strings.localeName == 'en'; + Future load() async { final localeCode = await findSystemLocale(); Locale locale = Locale(localeCode.split('_')[0]); diff --git a/lib/ui/app_scaffold.dart b/lib/ui/app_scaffold.dart index 32241cd5..9824c777 100644 --- a/lib/ui/app_scaffold.dart +++ b/lib/ui/app_scaffold.dart @@ -5,15 +5,6 @@ class WondersAppScaffold extends StatelessWidget with GetItMixin { WondersAppScaffold({Key? key, required this.child}) : super(key: key); final Widget child; - Future _handleSwapLocale() async { - final currentLocale = settingsLogic.currentLocale.value; - final newLocale = Locale(currentLocale == 'en' ? 'zh' : 'en'); - settingsLogic.currentLocale.value = newLocale.languageCode; - await localeLogic.refreshIfChanged(newLocale); - wondersLogic.init(); - timelineLogic.init(); - } - @override Widget build(BuildContext context) { Animate.defaultDuration = $styles.times.fast; @@ -31,24 +22,6 @@ class WondersAppScaffold extends StatelessWidget with GetItMixin { ), ), ), - - //TODO: just some test UI to check swapping behavior, need to get finalized design and location - Align( - alignment: Alignment.topRight, - child: SafeArea( - child: TextButton( - onPressed: _handleSwapLocale, - child: Container( - decoration: BoxDecoration( - color: $styles.colors.greyStrong.withOpacity(.7), - borderRadius: BorderRadius.all(Radius.circular($styles.corners.md)), - ), - padding: EdgeInsets.all($styles.insets.sm), - child: Text($strings.localeSwapButton, style: $styles.text.btn.copyWith(color: $styles.colors.white)), - ), - ), - ), - ), ], ); } diff --git a/lib/ui/common/controls/locale_button.dart b/lib/ui/common/controls/locale_button.dart new file mode 100644 index 00000000..76b262e5 --- /dev/null +++ b/lib/ui/common/controls/locale_button.dart @@ -0,0 +1,32 @@ +import 'package:flutter/src/foundation/key.dart'; +import 'package:flutter/src/widgets/container.dart'; +import 'package:flutter/src/widgets/framework.dart'; +import 'package:wonders/common_libs.dart'; + +class LocaleButton extends StatelessWidget { + const LocaleButton({Key? key}) : super(key: key); + + Future _handleSwapLocale() async { + final currentLocale = settingsLogic.currentLocale.value; + final newLocale = Locale(currentLocale == 'en' ? 'zh' : 'en'); + settingsLogic.currentLocale.value = newLocale.languageCode; + await localeLogic.refreshIfChanged(newLocale); + wondersLogic.init(); + timelineLogic.init(); + } + + @override + Widget build(BuildContext context) { + return TextButton( + onPressed: _handleSwapLocale, + child: Container( + decoration: BoxDecoration( + color: $styles.colors.greyStrong.withOpacity(.7), + borderRadius: BorderRadius.all(Radius.circular($styles.corners.md)), + ), + padding: EdgeInsets.all($styles.insets.sm), + child: Text($strings.localeSwapButton, style: $styles.text.btn.copyWith(color: $styles.colors.white)), + ), + ); + } +} diff --git a/lib/ui/screens/artifact/artifact_search/widgets/_results_grid.dart b/lib/ui/screens/artifact/artifact_search/widgets/_results_grid.dart index d2c89da2..ee891aca 100644 --- a/lib/ui/screens/artifact/artifact_search/widgets/_results_grid.dart +++ b/lib/ui/screens/artifact/artifact_search/widgets/_results_grid.dart @@ -31,11 +31,10 @@ class _ResultsGrid extends StatelessWidget { } Widget _buildLanguageMessage(BuildContext context) { - bool isEnglish = localeLogic.strings.localeName == 'en'; return ValueListenableBuilder( valueListenable: settingsLogic.hasDismissedSearchMessage, builder: (_, value, __) { - if (isEnglish || value) return SizedBox(); + if (localeLogic.isEnglish || value) return SizedBox(); return AppBtn.basic( onPressed: () => settingsLogic.hasDismissedSearchMessage.value = true, semanticLabel: $strings.resultsSemanticDismiss, diff --git a/lib/ui/screens/editorial/widgets/_scrolling_content.dart b/lib/ui/screens/editorial/widgets/_scrolling_content.dart index 9acf8a99..de320a02 100644 --- a/lib/ui/screens/editorial/widgets/_scrolling_content.dart +++ b/lib/ui/screens/editorial/widgets/_scrolling_content.dart @@ -28,8 +28,7 @@ class _ScrollingContent extends StatelessWidget { final String dropChar = value.substring(0, 1); final textScale = MediaQuery.of(context).textScaleFactor; final double dropCapWidth = StringUtils.measure(dropChar, dropStyle).width * textScale; - final bool isEnglish = localeLogic.strings.localeName == 'en'; //TODO EC: Helper method for localLogic.isEnglish? - final bool skipCaps = !isEnglish || MediaQuery.of(context).accessibleNavigation; + final bool skipCaps = !localeLogic.isEnglish || MediaQuery.of(context).accessibleNavigation; return Semantics( label: value, child: !skipCaps diff --git a/lib/ui/screens/home_menu/home_menu.dart b/lib/ui/screens/home_menu/home_menu.dart index 99ffbe1a..fbdf1d9a 100644 --- a/lib/ui/screens/home_menu/home_menu.dart +++ b/lib/ui/screens/home_menu/home_menu.dart @@ -4,6 +4,7 @@ import 'package:wonders/common_libs.dart'; import 'package:wonders/logic/data/wonder_data.dart'; import 'package:wonders/ui/common/app_backdrop.dart'; import 'package:wonders/ui/common/app_icons.dart'; +import 'package:wonders/ui/common/controls/locale_button.dart'; import 'package:wonders/ui/screens/home_menu/about_dialog_content.dart'; class HomeMenu extends StatelessWidget { @@ -75,7 +76,17 @@ class HomeMenu extends StatelessWidget { ), ), ), - ) + ), + Positioned( + right: -$styles.insets.xs, + top: $styles.insets.xs, + child: SafeArea( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: $styles.insets.lg), + child: LocaleButton(), + ), + ), + ), ], ); } diff --git a/lib/ui/screens/intro/intro_screen.dart b/lib/ui/screens/intro/intro_screen.dart index d0afe413..0e7bf99a 100644 --- a/lib/ui/screens/intro/intro_screen.dart +++ b/lib/ui/screens/intro/intro_screen.dart @@ -2,6 +2,7 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:wonders/common_libs.dart'; import 'package:wonders/ui/common/app_icons.dart'; import 'package:wonders/ui/common/controls/app_page_indicator.dart'; +import 'package:wonders/ui/common/controls/locale_button.dart'; import 'package:wonders/ui/common/static_text_scale.dart'; import 'package:wonders/ui/common/themed_text.dart'; import 'package:wonders/ui/common/utils/app_haptics.dart'; @@ -137,6 +138,12 @@ class _IntroScreenState extends State { child: _buildNavText(context), ), ), + + Positioned( + right: 0, + top: 0, + child: LocaleButton(), + ), ]); return DefaultTextColor( From 828f353d26011877629ba350478fcfcbd18e0e48 Mon Sep 17 00:00:00 2001 From: Eddie Date: Tue, 6 Sep 2022 16:44:29 -0600 Subject: [PATCH 04/15] Fix for localeButton not updating --- lib/ui/common/controls/locale_button.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ui/common/controls/locale_button.dart b/lib/ui/common/controls/locale_button.dart index 76b262e5..5d958d95 100644 --- a/lib/ui/common/controls/locale_button.dart +++ b/lib/ui/common/controls/locale_button.dart @@ -25,7 +25,12 @@ class LocaleButton extends StatelessWidget { borderRadius: BorderRadius.all(Radius.circular($styles.corners.md)), ), padding: EdgeInsets.all($styles.insets.sm), - child: Text($strings.localeSwapButton, style: $styles.text.btn.copyWith(color: $styles.colors.white)), + child: ValueListenableBuilder( + valueListenable: settingsLogic.currentLocale, + builder: (_, __, ___) { + return Text($strings.localeSwapButton, style: $styles.text.btn.copyWith(color: $styles.colors.white)); + }, + ), ), ); } From b080a5b2e9fb01ab84365986faf5a153ba95dc7c Mon Sep 17 00:00:00 2001 From: Shawn Date: Wed, 7 Sep 2022 13:25:56 -0600 Subject: [PATCH 05/15] add setLocale method on settings --- lib/logic/settings_logic.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/logic/settings_logic.dart b/lib/logic/settings_logic.dart index 3a09ae84..23a19059 100644 --- a/lib/logic/settings_logic.dart +++ b/lib/logic/settings_logic.dart @@ -1,4 +1,5 @@ import 'package:flutter/foundation.dart'; +import 'package:wonders/common_libs.dart'; import 'package:wonders/logic/common/save_load_mixin.dart'; class SettingsLogic with ThrottledSaveLoadMixin { @@ -24,4 +25,11 @@ class SettingsLogic with ThrottledSaveLoadMixin { 'hasDismissedSearchMessage': hasDismissedSearchMessage.value, }; } + + Future setLocale(Locale value) async { + currentLocale.value = value.languageCode; + await localeLogic.refreshIfChanged(value); + wondersLogic.init(); + timelineLogic.init(); + } } From 31be98dd260db0d76bfbdb2a8a1869afc6b6b285 Mon Sep 17 00:00:00 2001 From: Shawn Date: Wed, 7 Sep 2022 13:26:30 -0600 Subject: [PATCH 06/15] Switch LocalBtn to use AppBtn --- lib/ui/common/controls/locale_button.dart | 42 +++++++---------------- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/lib/ui/common/controls/locale_button.dart b/lib/ui/common/controls/locale_button.dart index 5d958d95..3f9b3914 100644 --- a/lib/ui/common/controls/locale_button.dart +++ b/lib/ui/common/controls/locale_button.dart @@ -1,37 +1,19 @@ -import 'package:flutter/src/foundation/key.dart'; -import 'package:flutter/src/widgets/container.dart'; -import 'package:flutter/src/widgets/framework.dart'; import 'package:wonders/common_libs.dart'; -class LocaleButton extends StatelessWidget { - const LocaleButton({Key? key}) : super(key: key); - - Future _handleSwapLocale() async { - final currentLocale = settingsLogic.currentLocale.value; - final newLocale = Locale(currentLocale == 'en' ? 'zh' : 'en'); - settingsLogic.currentLocale.value = newLocale.languageCode; - await localeLogic.refreshIfChanged(newLocale); - wondersLogic.init(); - timelineLogic.init(); - } +class LocaleButton extends StatelessWidget with GetItMixin { + LocaleButton({Key? key}) : super(key: key); @override Widget build(BuildContext context) { - return TextButton( - onPressed: _handleSwapLocale, - child: Container( - decoration: BoxDecoration( - color: $styles.colors.greyStrong.withOpacity(.7), - borderRadius: BorderRadius.all(Radius.circular($styles.corners.md)), - ), - padding: EdgeInsets.all($styles.insets.sm), - child: ValueListenableBuilder( - valueListenable: settingsLogic.currentLocale, - builder: (_, __, ___) { - return Text($strings.localeSwapButton, style: $styles.text.btn.copyWith(color: $styles.colors.white)); - }, - ), - ), - ); + final locale = watchX((SettingsLogic s) => s.currentLocale); + Future handleSwapLocale() async { + final newLocale = Locale(locale == 'en' ? 'zh' : 'en'); + await settingsLogic.setLocale(newLocale); + } + + return AppBtn.from( + padding: EdgeInsets.symmetric(vertical: $styles.insets.sm, horizontal: $styles.insets.sm), + text: $strings.localeSwapButton, + onPressed: handleSwapLocale); } } From 65d5fd48d3357849508222b64ab2c92c216e2cfb Mon Sep 17 00:00:00 2001 From: Shawn Date: Wed, 7 Sep 2022 13:28:41 -0600 Subject: [PATCH 07/15] Rename to LocaleSwitcher, tweak HomeMenu layout --- ...ocale_button.dart => locale_switcher.dart} | 4 +-- lib/ui/screens/home_menu/home_menu.dart | 34 ++++++++++--------- lib/ui/screens/intro/intro_screen.dart | 4 +-- 3 files changed, 22 insertions(+), 20 deletions(-) rename lib/ui/common/controls/{locale_button.dart => locale_switcher.dart} (82%) diff --git a/lib/ui/common/controls/locale_button.dart b/lib/ui/common/controls/locale_switcher.dart similarity index 82% rename from lib/ui/common/controls/locale_button.dart rename to lib/ui/common/controls/locale_switcher.dart index 3f9b3914..9150b9c2 100644 --- a/lib/ui/common/controls/locale_button.dart +++ b/lib/ui/common/controls/locale_switcher.dart @@ -1,7 +1,7 @@ import 'package:wonders/common_libs.dart'; -class LocaleButton extends StatelessWidget with GetItMixin { - LocaleButton({Key? key}) : super(key: key); +class LocaleSwitcher extends StatelessWidget with GetItMixin { + LocaleSwitcher({Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/ui/screens/home_menu/home_menu.dart b/lib/ui/screens/home_menu/home_menu.dart index fbdf1d9a..138e0694 100644 --- a/lib/ui/screens/home_menu/home_menu.dart +++ b/lib/ui/screens/home_menu/home_menu.dart @@ -4,7 +4,7 @@ import 'package:wonders/common_libs.dart'; import 'package:wonders/logic/data/wonder_data.dart'; import 'package:wonders/ui/common/app_backdrop.dart'; import 'package:wonders/ui/common/app_icons.dart'; -import 'package:wonders/ui/common/controls/locale_button.dart'; +import 'package:wonders/ui/common/controls/locale_switcher.dart'; import 'package:wonders/ui/screens/home_menu/about_dialog_content.dart'; class HomeMenu extends StatelessWidget { @@ -50,11 +50,23 @@ class HomeMenu extends StatelessWidget { ), ), - /// Back btn - BackBtn.close( - bgColor: Colors.transparent, - iconColor: $styles.colors.offWhite, - ).safe(), + SafeArea( + child: PaddedRow( + padding: EdgeInsets.symmetric( + horizontal: $styles.insets.md, + vertical: $styles.insets.sm, + ), + children: [ + /// Back btn + BackBtn.close( + bgColor: Colors.transparent, + iconColor: $styles.colors.offWhite, + ), + Spacer(), + LocaleSwitcher() + ], + ), + ), /// Content Positioned.fill( @@ -77,16 +89,6 @@ class HomeMenu extends StatelessWidget { ), ), ), - Positioned( - right: -$styles.insets.xs, - top: $styles.insets.xs, - child: SafeArea( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: $styles.insets.lg), - child: LocaleButton(), - ), - ), - ), ], ); } diff --git a/lib/ui/screens/intro/intro_screen.dart b/lib/ui/screens/intro/intro_screen.dart index 0e7bf99a..1ec5fa70 100644 --- a/lib/ui/screens/intro/intro_screen.dart +++ b/lib/ui/screens/intro/intro_screen.dart @@ -2,7 +2,7 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:wonders/common_libs.dart'; import 'package:wonders/ui/common/app_icons.dart'; import 'package:wonders/ui/common/controls/app_page_indicator.dart'; -import 'package:wonders/ui/common/controls/locale_button.dart'; +import 'package:wonders/ui/common/controls/locale_switcher.dart'; import 'package:wonders/ui/common/static_text_scale.dart'; import 'package:wonders/ui/common/themed_text.dart'; import 'package:wonders/ui/common/utils/app_haptics.dart'; @@ -142,7 +142,7 @@ class _IntroScreenState extends State { Positioned( right: 0, top: 0, - child: LocaleButton(), + child: LocaleSwitcher(), ), ]); From d7952ed1ab12e0ca7e7f91039df690291b99193b Mon Sep 17 00:00:00 2001 From: Shawn Date: Wed, 7 Sep 2022 13:44:20 -0600 Subject: [PATCH 08/15] Remove from intro screen --- lib/ui/screens/intro/intro_screen.dart | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/ui/screens/intro/intro_screen.dart b/lib/ui/screens/intro/intro_screen.dart index 1ec5fa70..e7006123 100644 --- a/lib/ui/screens/intro/intro_screen.dart +++ b/lib/ui/screens/intro/intro_screen.dart @@ -138,12 +138,6 @@ class _IntroScreenState extends State { child: _buildNavText(context), ), ), - - Positioned( - right: 0, - top: 0, - child: LocaleSwitcher(), - ), ]); return DefaultTextColor( From ef1c4d8a8abea80a9297ac11975654be102c4de3 Mon Sep 17 00:00:00 2001 From: Shawn Date: Wed, 7 Sep 2022 13:50:46 -0600 Subject: [PATCH 09/15] Tweak pull quote to collapse for longer --- .../screens/editorial/widgets/_collapsing_pull_quote_image.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/screens/editorial/widgets/_collapsing_pull_quote_image.dart b/lib/ui/screens/editorial/widgets/_collapsing_pull_quote_image.dart index 2d90c1c3..3b24528e 100644 --- a/lib/ui/screens/editorial/widgets/_collapsing_pull_quote_image.dart +++ b/lib/ui/screens/editorial/widgets/_collapsing_pull_quote_image.dart @@ -9,7 +9,7 @@ class _CollapsingPullQuoteImage extends StatelessWidget { Widget build(BuildContext context) { // Start transitioning when we are halfway up the screen final collapseStartPx = context.heightPx * 1; - final collapseEndPx = context.heightPx * .35; + final collapseEndPx = context.heightPx * .15; const double imgHeight = 430; const double outerPadding = 100; From 13eec8392d7057746b7acfbd6dbcdb0f95f87c32 Mon Sep 17 00:00:00 2001 From: Shawn Date: Wed, 7 Sep 2022 13:52:53 -0600 Subject: [PATCH 10/15] Restore shimmer effect --- lib/ui/common/collectible_item.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/ui/common/collectible_item.dart b/lib/ui/common/collectible_item.dart index 25f45bbf..5fa39dc0 100644 --- a/lib/ui/common/collectible_item.dart +++ b/lib/ui/common/collectible_item.dart @@ -52,13 +52,12 @@ class CollectibleItem extends StatelessWidget with GetItMixin { ), ) .animate(onPlay: (controller) => controller.repeat()) - // TODO SB (Aug 17, 2022): Temporarily removed on Jonahs request, due to a bug in Impeller which should be fixed soon. Re-enable when fixed. - //.shimmer(delay: 4000.ms, duration: $styles.times.med * 3) - .shake(delay: 4000.ms, duration: $styles.times.med * 3, curve: Curves.easeInOutCubic, hz: 4) + .shimmer(delay: 4000.ms, duration: $styles.times.med * 3) + .shake(curve: Curves.easeInOutCubic, hz: 4) .scale(begin: 1.0, end: 1.1, duration: $styles.times.med) .then(delay: $styles.times.med) .scale(begin: 1.0, end: 1 / 1.1), - ), + ), ), ), ); From 060a028e3b526f590b31ff8142553342fb8008ed Mon Sep 17 00:00:00 2001 From: Shawn Date: Wed, 7 Sep 2022 13:54:32 -0600 Subject: [PATCH 11/15] Cleanup lint warnings --- lib/logic/locale_logic.dart | 4 +--- lib/ui/screens/intro/intro_screen.dart | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/logic/locale_logic.dart b/lib/logic/locale_logic.dart index 414d6f30..509dd884 100644 --- a/lib/logic/locale_logic.dart +++ b/lib/logic/locale_logic.dart @@ -1,8 +1,6 @@ -import 'dart:ui'; - import 'package:flutter/foundation.dart'; -import 'package:intl/intl_standalone.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:intl/intl_standalone.dart'; import 'package:wonders/common_libs.dart'; class LocaleLogic { diff --git a/lib/ui/screens/intro/intro_screen.dart b/lib/ui/screens/intro/intro_screen.dart index e7006123..d0afe413 100644 --- a/lib/ui/screens/intro/intro_screen.dart +++ b/lib/ui/screens/intro/intro_screen.dart @@ -2,7 +2,6 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:wonders/common_libs.dart'; import 'package:wonders/ui/common/app_icons.dart'; import 'package:wonders/ui/common/controls/app_page_indicator.dart'; -import 'package:wonders/ui/common/controls/locale_switcher.dart'; import 'package:wonders/ui/common/static_text_scale.dart'; import 'package:wonders/ui/common/themed_text.dart'; import 'package:wonders/ui/common/utils/app_haptics.dart'; From 3e918aab290a72e8a64c333cadb362a8f6dea2b0 Mon Sep 17 00:00:00 2001 From: Shawn Date: Wed, 7 Sep 2022 15:12:57 -0600 Subject: [PATCH 12/15] Update release notes --- release_notes.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release_notes.txt b/release_notes.txt index 7c5a0593..8083fe0a 100644 --- a/release_notes.txt +++ b/release_notes.txt @@ -1,6 +1,9 @@ # 1.9.0 - Improved support for dynamic text scaling - Improved performance for blend modes and blurs +- Added LocalSwitcher btn in the main Wonders Menu +- Request higher preferred FPS for Android devices +- Fix rendering issues with Chinese fonts # 1.8.0 - Initial release \ No newline at end of file From d682f29b75ee6e353f364532c4a00f2d78c2d3ea Mon Sep 17 00:00:00 2001 From: Shawn Date: Wed, 7 Sep 2022 15:16:33 -0600 Subject: [PATCH 13/15] Tweak spacing, increase font size for colosseum and christRedeemer --- lib/ui/screens/home/wonders_home_screen.dart | 9 +-------- .../wonder_illustrations/common/wonder_title_text.dart | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/ui/screens/home/wonders_home_screen.dart b/lib/ui/screens/home/wonders_home_screen.dart index a4cd9f58..23710a46 100644 --- a/lib/ui/screens/home/wonders_home_screen.dart +++ b/lib/ui/screens/home/wonders_home_screen.dart @@ -177,8 +177,7 @@ class _HomeScreenState extends State with SingleTickerProviderStateM child: Column( children: [ WonderTitleText(currentWonder, enableShadows: true), - - //Gap($styles.insets.sm), + Gap($styles.insets.xs), AppPageIndicator( count: _numWonders, controller: _pageController, @@ -187,17 +186,11 @@ class _HomeScreenState extends State with SingleTickerProviderStateM onDotPressed: _handlePageIndicatorDotPressed, semanticPageTitle: $strings.homeSemanticWonder, ), - - /// Page indicator - // IgnorePointer( - // child: DiagonalTextPageIndicator(current: _wonderIndex + 1, total: _numWonders), - // ), ], ), ), ), ), - //Gap($styles.insets.xs), /// Animated arrow and background /// Wrap in a container that is full-width to make it easier to find for screen readers diff --git a/lib/ui/wonder_illustrations/common/wonder_title_text.dart b/lib/ui/wonder_illustrations/common/wonder_title_text.dart index 6737cdd6..a16e638c 100644 --- a/lib/ui/wonder_illustrations/common/wonder_title_text.dart +++ b/lib/ui/wonder_illustrations/common/wonder_title_text.dart @@ -17,7 +17,7 @@ class WonderTitleText extends StatelessWidget { ); bool smallText = [WonderType.christRedeemer, WonderType.colosseum].contains(data.type); if (smallText) { - textStyle = textStyle.copyWith(fontSize: 48); + textStyle = textStyle.copyWith(fontSize: 56); } // First, get a list like: ['the\n', 'great wall'] From cdcc9284d5cc5e467970d8008d59e56edaf14952 Mon Sep 17 00:00:00 2001 From: Shawn Date: Wed, 7 Sep 2022 15:39:52 -0600 Subject: [PATCH 14/15] Increase vertical spacing on home page --- lib/ui/screens/home/wonders_home_screen.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ui/screens/home/wonders_home_screen.dart b/lib/ui/screens/home/wonders_home_screen.dart index 23710a46..b7743218 100644 --- a/lib/ui/screens/home/wonders_home_screen.dart +++ b/lib/ui/screens/home/wonders_home_screen.dart @@ -177,7 +177,7 @@ class _HomeScreenState extends State with SingleTickerProviderStateM child: Column( children: [ WonderTitleText(currentWonder, enableShadows: true), - Gap($styles.insets.xs), + Gap($styles.insets.md), AppPageIndicator( count: _numWonders, controller: _pageController, @@ -186,6 +186,7 @@ class _HomeScreenState extends State with SingleTickerProviderStateM onDotPressed: _handlePageIndicatorDotPressed, semanticPageTitle: $strings.homeSemanticWonder, ), + Gap($styles.insets.md), ], ), ), From 269f4062e85b94e26633555f64c2f186178dc625 Mon Sep 17 00:00:00 2001 From: Shawn Date: Wed, 7 Sep 2022 18:48:04 -0600 Subject: [PATCH 15/15] Remove pool element from TajMahal Hero --- .../taj_mahal_illustration.dart | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/ui/wonder_illustrations/taj_mahal_illustration.dart b/lib/ui/wonder_illustrations/taj_mahal_illustration.dart index 93f52a2e..fbe9dbbb 100644 --- a/lib/ui/wonder_illustrations/taj_mahal_illustration.dart +++ b/lib/ui/wonder_illustrations/taj_mahal_illustration.dart @@ -56,17 +56,20 @@ class TajMahalIllustration extends StatelessWidget { alignment: Alignment(0, config.shortMode ? 1 : -.15), child: FractionallySizedBox( widthFactor: config.shortMode ? 1 : 1.7, - child: WonderHero(config, 'taj-mg', - child: Stack( - children: [ - Image.asset('$assetPath/taj-mahal.png', opacity: anim, fit: BoxFit.cover), - if (!config.shortMode) - FractionalTranslation( - translation: Offset(0, 1.33), - child: Image.asset('$assetPath/pool.png', opacity: anim, fit: BoxFit.cover), - ), - ], - )), + child: Stack( + children: [ + WonderHero( + config, + 'taj-mg', + child: Image.asset('$assetPath/taj-mahal.png', opacity: anim, fit: BoxFit.cover), + ), + if (!config.shortMode) + FractionalTranslation( + translation: Offset(0, 1.33), + child: Image.asset('$assetPath/pool.png', opacity: anim, fit: BoxFit.cover), + ), + ], + ), ), ), )