Render startup immediately and defer native work with a smooth home transition
This commit is contained in:
@@ -3,43 +3,50 @@ import 'package:flutter/services.dart';
|
||||
|
||||
import '../widgets/tp_logo.dart';
|
||||
|
||||
/// The first Flutter frame while saved data and reminder services initialize.
|
||||
/// Matching native artwork while saved data initializes.
|
||||
class TpLaunchPage extends StatelessWidget {
|
||||
const TpLaunchPage({super.key});
|
||||
const TpLaunchPage({super.key, this.nativeContinuity = false});
|
||||
final bool nativeContinuity;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => AnnotatedRegion<SystemUiOverlayStyle>(
|
||||
value: const SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
statusBarIconBrightness: Brightness.light,
|
||||
statusBarBrightness: Brightness.dark,
|
||||
systemNavigationBarColor: Color(0xFF38B3FF),
|
||||
systemNavigationBarIconBrightness: Brightness.light,
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: const Color(0xFF38B3FF),
|
||||
body: DecoratedBox(
|
||||
decoration: const BoxDecoration(gradient: tpBrandGradient),
|
||||
child: SizedBox.expand(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const TpLogo(size: 120, background: false),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'TPSchedule',
|
||||
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: 0.4,
|
||||
Widget build(BuildContext context) => nativeContinuity
|
||||
? const ColoredBox(
|
||||
color: Color(0xFF38B3FF),
|
||||
child: Center(child: TpLogo(size: 188.8, background: false)),
|
||||
)
|
||||
: AnnotatedRegion<SystemUiOverlayStyle>(
|
||||
value: const SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
statusBarIconBrightness: Brightness.light,
|
||||
statusBarBrightness: Brightness.dark,
|
||||
systemNavigationBarColor: Color(0xFF38B3FF),
|
||||
systemNavigationBarIconBrightness: Brightness.light,
|
||||
),
|
||||
child: Scaffold(
|
||||
backgroundColor: const Color(0xFF38B3FF),
|
||||
body: DecoratedBox(
|
||||
decoration: const BoxDecoration(gradient: tpBrandGradient),
|
||||
child: SizedBox.expand(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const TpLogo(size: 120, background: false),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'TPSchedule',
|
||||
style: Theme.of(context).textTheme.headlineSmall
|
||||
?.copyWith(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w600,
|
||||
letterSpacing: 0.4,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user