full app done
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
/// First route shown after launch. Hands off to [MainShell] after a short delay.
|
||||
/// First route shown after launch. Hands off to the practice flow.
|
||||
library;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../utils/constants.dart';
|
||||
import 'main_shell.dart';
|
||||
import 'practice_flow_screen.dart';
|
||||
|
||||
/// Branded splash with a fade-in logo. Replaced by the bottom-nav shell.
|
||||
/// Soft branded splash before the welcome screen.
|
||||
class SplashScreen extends StatefulWidget {
|
||||
const SplashScreen({super.key});
|
||||
|
||||
@@ -32,17 +32,17 @@ class _SplashScreenState extends State<SplashScreen>
|
||||
CurvedAnimation(parent: _controller, curve: Curves.easeOutBack),
|
||||
);
|
||||
_controller.forward();
|
||||
_goToShell();
|
||||
_goToPractice();
|
||||
}
|
||||
|
||||
Future<void> _goToShell() async {
|
||||
Future<void> _goToPractice() async {
|
||||
await Future<void>.delayed(kSplashDuration);
|
||||
if (!mounted) return;
|
||||
Navigator.of(context).pushReplacement(
|
||||
PageRouteBuilder<void>(
|
||||
pageBuilder: (_, animation, _) => FadeTransition(
|
||||
opacity: animation,
|
||||
child: const MainShell(),
|
||||
child: const PracticeFlowScreen(),
|
||||
),
|
||||
transitionDuration: const Duration(milliseconds: 400),
|
||||
),
|
||||
@@ -57,20 +57,27 @@ class _SplashScreenState extends State<SplashScreen>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
final textTheme = Theme.of(context).textTheme;
|
||||
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
final isDark = colors.brightness == Brightness.dark;
|
||||
return Scaffold(
|
||||
body: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
colors.primary,
|
||||
colors.primaryContainer,
|
||||
colors.tertiary,
|
||||
],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: isDark
|
||||
? [
|
||||
colors.surface,
|
||||
colors.surfaceContainerLow,
|
||||
colors.surfaceContainer,
|
||||
]
|
||||
: [
|
||||
colors.surface,
|
||||
colors.surfaceContainerLow,
|
||||
const Color(0xFFE8DFD2),
|
||||
],
|
||||
),
|
||||
),
|
||||
child: SafeArea(
|
||||
@@ -82,31 +89,36 @@ class _SplashScreenState extends State<SplashScreen>
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
width: 88,
|
||||
height: 88,
|
||||
decoration: BoxDecoration(
|
||||
color: colors.onPrimary.withValues(alpha: 0.16),
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.layers_rounded,
|
||||
size: 44,
|
||||
color: colors.onPrimary,
|
||||
ClipOval(
|
||||
child: Image.asset(
|
||||
'assets/images/emblem.png',
|
||||
width: 88,
|
||||
height: 88,
|
||||
fit: BoxFit.cover,
|
||||
errorBuilder: (_, _, _) => Container(
|
||||
width: 88,
|
||||
height: 88,
|
||||
color: colors.primaryContainer,
|
||||
child: const Icon(
|
||||
Icons.spa,
|
||||
size: 44,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
Text(
|
||||
kAppName,
|
||||
style: textTheme.displaySmall?.copyWith(
|
||||
color: colors.onPrimary,
|
||||
color: colors.onSurface,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'A Material 3 starter template',
|
||||
'Clarify what guides you',
|
||||
style: textTheme.bodyLarge?.copyWith(
|
||||
color: colors.onPrimary.withValues(alpha: 0.85),
|
||||
color: colors.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
@@ -115,7 +127,7 @@ class _SplashScreenState extends State<SplashScreen>
|
||||
height: 28,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 3,
|
||||
color: colors.onPrimary,
|
||||
color: colors.primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user