Add support for android12 splash screen

Polish locale implementation
This commit is contained in:
Shawn 2022-09-08 09:51:31 -06:00
parent 269f4062e8
commit 636153e6de
13 changed files with 36 additions and 34 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

View File

@ -5,6 +5,8 @@
<item name="android:forceDarkAllowed">false</item> <item name="android:forceDarkAllowed">false</item>
<item name="android:windowFullscreen">false</item> <item name="android:windowFullscreen">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item> <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowSplashScreenBackground">#272625</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
</style> </style>
<!-- Theme applied to the Android Window as soon as the process has started. <!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your This theme determines the color of the Android Window while your

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -49,10 +49,10 @@ flutter_native_splash:
# 640 pixels in diameter. # 640 pixels in diameter.
# App icon without an icon background: This should be 1152×1152 pixels, and fit within a circle # App icon without an icon background: This should be 1152×1152 pixels, and fit within a circle
# 768 pixels in diameter. # 768 pixels in diameter.
#image: assets/android12splash.png image: assets/marketing/app-logo-android12.png
# Splash screen background color. # Splash screen background color.
#color: "#42a5f5" color: "#272625"
# App icon background color. # App icon background color.
#icon_background_color: "#111111" #icon_background_color: "#111111"

View File

@ -26,29 +26,25 @@ void main() async {
} }
/// Creates an app using the [MaterialApp.router] constructor and the `appRouter`, an instance of [GoRouter]. /// Creates an app using the [MaterialApp.router] constructor and the `appRouter`, an instance of [GoRouter].
class WondersApp extends StatelessWidget { class WondersApp extends StatelessWidget with GetItMixin {
const WondersApp({Key? key}) : super(key: key); WondersApp({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ValueListenableBuilder<String>( final locale = watchX((SettingsLogic s) => s.currentLocale);
valueListenable: settingsLogic.currentLocale, return MaterialApp.router(
builder: (_, localeCode, __) { locale: Locale(locale),
return MaterialApp.router( debugShowCheckedModeBanner: false,
locale: Locale(localeCode), routerDelegate: appRouter.routerDelegate,
debugShowCheckedModeBanner: false, routeInformationProvider: appRouter.routeInformationProvider,
routerDelegate: appRouter.routerDelegate, routeInformationParser: appRouter.routeInformationParser,
routeInformationProvider: appRouter.routeInformationProvider, theme: ThemeData(fontFamily: $styles.text.body.fontFamily),
routeInformationParser: appRouter.routeInformationParser, localizationsDelegates: const [
theme: ThemeData(fontFamily: $styles.text.body.fontFamily), AppLocalizations.delegate,
localizationsDelegates: const [ GlobalMaterialLocalizations.delegate,
AppLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, ],
GlobalCupertinoLocalizations.delegate, supportedLocales: AppLocalizations.supportedLocales,
],
supportedLocales: AppLocalizations.supportedLocales,
);
}
); );
} }
} }

View File

@ -31,7 +31,7 @@ class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateM
viewportFraction: 1, viewportFraction: 1,
initialPage: _numWonders * 9999, // allow 'infinite' scrolling by starting at a very high page initialPage: _numWonders * 9999, // allow 'infinite' scrolling by starting at a very high page
); );
final _wonders = wondersLogic.all; List<WonderData> get _wonders => wondersLogic.all;
bool _isMenuOpen = false; bool _isMenuOpen = false;
/// Set initial wonderIndex /// Set initial wonderIndex

View File

@ -31,7 +31,7 @@ class _TopContent extends StatelessWidget {
/// Title text /// Title text
BottomCenter( BottomCenter(
child: WonderTitleText(data), child: WonderTitleText(data, enableHero: false),
) )
]), ]),
), ),

View File

@ -7,9 +7,10 @@ import 'package:wonders/logic/data/wonder_data.dart';
/// - of/the should be down-sized /// - of/the should be down-sized
/// Accomplished using a set of TextSpans, and a white list of 'small words' /// Accomplished using a set of TextSpans, and a white list of 'small words'
class WonderTitleText extends StatelessWidget { class WonderTitleText extends StatelessWidget {
const WonderTitleText(this.data, {Key? key, this.enableShadows = false}) : super(key: key); const WonderTitleText(this.data, {Key? key, this.enableShadows = false, this.enableHero = true}) : super(key: key);
final WonderData data; final WonderData data;
final bool enableShadows; final bool enableShadows;
final bool enableHero;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var textStyle = $styles.text.wonderTitle.copyWith( var textStyle = $styles.text.wonderTitle.copyWith(
@ -41,15 +42,18 @@ class WonderTitleText extends StatelessWidget {
} }
List<Shadow> shadows = enableShadows ? $styles.shadows.textSoft : []; List<Shadow> shadows = enableShadows ? $styles.shadows.textSoft : [];
return Hero( var content = RichText(
tag: 'wonderTitle-$title', textAlign: TextAlign.center,
child: RichText( text: TextSpan(
textAlign: TextAlign.center, style: textStyle.copyWith(shadows: shadows),
text: TextSpan( children: pieces.map(buildTextSpan).toList(),
style: textStyle.copyWith(shadows: shadows),
children: pieces.map(buildTextSpan).toList(),
),
), ),
); );
return enableHero
? Hero(
tag: 'wonderTitle-$title',
child: content,
)
: content;
} }
} }