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:windowFullscreen">false</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowSplashScreenBackground">#272625</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/android12splash</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
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.
# App icon without an icon background: This should be 1152×1152 pixels, and fit within a circle
# 768 pixels in diameter.
#image: assets/android12splash.png
image: assets/marketing/app-logo-android12.png
# Splash screen background color.
#color: "#42a5f5"
color: "#272625"
# App icon background color.
#icon_background_color: "#111111"

View File

@ -26,15 +26,13 @@ void main() async {
}
/// Creates an app using the [MaterialApp.router] constructor and the `appRouter`, an instance of [GoRouter].
class WondersApp extends StatelessWidget {
const WondersApp({Key? key}) : super(key: key);
class WondersApp extends StatelessWidget with GetItMixin {
WondersApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return ValueListenableBuilder<String>(
valueListenable: settingsLogic.currentLocale,
builder: (_, localeCode, __) {
final locale = watchX((SettingsLogic s) => s.currentLocale);
return MaterialApp.router(
locale: Locale(localeCode),
locale: Locale(locale),
debugShowCheckedModeBanner: false,
routerDelegate: appRouter.routerDelegate,
routeInformationProvider: appRouter.routeInformationProvider,
@ -49,8 +47,6 @@ class WondersApp extends StatelessWidget {
supportedLocales: AppLocalizations.supportedLocales,
);
}
);
}
}
/// Create singletons (controllers and services) that can be shared across the app.

View File

@ -31,7 +31,7 @@ class _HomeScreenState extends State<HomeScreen> with SingleTickerProviderStateM
viewportFraction: 1,
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;
/// Set initial wonderIndex

View File

@ -31,7 +31,7 @@ class _TopContent extends StatelessWidget {
/// Title text
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
/// Accomplished using a set of TextSpans, and a white list of 'small words'
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 bool enableShadows;
final bool enableHero;
@override
Widget build(BuildContext context) {
var textStyle = $styles.text.wonderTitle.copyWith(
@ -41,15 +42,18 @@ class WonderTitleText extends StatelessWidget {
}
List<Shadow> shadows = enableShadows ? $styles.shadows.textSoft : [];
return Hero(
tag: 'wonderTitle-$title',
child: RichText(
var content = RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: textStyle.copyWith(shadows: shadows),
children: pieces.map(buildTextSpan).toList(),
),
),
);
return enableHero
? Hero(
tag: 'wonderTitle-$title',
child: content,
)
: content;
}
}