m7c: brand splash instead of the white startup screen
- LaunchTheme/NormalTheme on #05070A (was the stock light theme + white windowBackground) and the Android 12 splash API in values-v31 - splash icon is a padded 512x512 canvas: Android masks everything outside the inner 192dp of the 288dp icon area, which clipped the wordmark at the top; the icon plate is set to the icon navy - Flutter splash (lib/src/ui/splash_screen.dart): logo pulses (scale 0.96-1.04, opacity 0.72-1.0, 1100 ms) plus a thin progress line, min 700 ms measured from the first Flutter frame - boot work (session, FFI library, ad SDK) now runs after the first frame and the game fades in over the splash: no blocking work before the first frame - numbers (Redmi Note 10, API 31): debug 3053 ms, profile/AOT 2040 ms on the first start, 850-960 ms on later cold starts, ready log ~1030 ms - fixed: top-level Stopwatch only started on first access (Dart lazily initialises top-level finals), so the boot log always showed 0 ms - tools/device/startup.sh measures cold start + boot log; testing.md documents the splash chain and the MIUI release-install trap
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Brand splash shown while the native match library, the session and the
|
||||
/// ad SDK boot. The logo pulses so a cold start reads as "loading" instead of
|
||||
/// a frozen screen - the native launch theme uses the same colour and image,
|
||||
/// so the handover from the Android window to Flutter is invisible.
|
||||
class SplashScreen extends StatefulWidget {
|
||||
const SplashScreen({super.key});
|
||||
|
||||
/// Canvas colour of the game; the Android launch theme uses the same value.
|
||||
static const background = Color(0xFF05070A);
|
||||
static const accent = Color(0xFFFF8A3D);
|
||||
|
||||
@override
|
||||
State<SplashScreen> createState() => _SplashScreenState();
|
||||
}
|
||||
|
||||
class _SplashScreenState extends State<SplashScreen>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late final AnimationController _pulse = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 1100),
|
||||
)..repeat(reverse: true);
|
||||
|
||||
late final Animation<double> _scale = Tween<double>(begin: 0.96, end: 1.04)
|
||||
.animate(CurvedAnimation(parent: _pulse, curve: Curves.easeInOut));
|
||||
late final Animation<double> _opacity = Tween<double>(begin: 0.72, end: 1.0)
|
||||
.animate(CurvedAnimation(parent: _pulse, curve: Curves.easeInOut));
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_pulse.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ColoredBox(
|
||||
color: SplashScreen.background,
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
FadeTransition(
|
||||
opacity: _opacity,
|
||||
child: ScaleTransition(
|
||||
scale: _scale,
|
||||
child: Image.asset(
|
||||
'assets/logo_mark.png',
|
||||
width: 220,
|
||||
filterQuality: FilterQuality.medium,
|
||||
semanticLabel: 'Iron Arc',
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 28),
|
||||
// Thin indeterminate bar: tells the player the app is working,
|
||||
// not hung. Kept subtle so the logo stays the focus.
|
||||
SizedBox(
|
||||
width: 140,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
child: LinearProgressIndicator(
|
||||
minHeight: 2,
|
||||
color: SplashScreen.accent,
|
||||
backgroundColor: const Color(0xFF16202E),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user