mirror of
https://github.com/koloideal/Casha.git
synced 2026-06-10 10:25:28 +03:00
update
This commit is contained in:
+6
-1
@@ -4,13 +4,18 @@ import '../features/dashboard/screen.dart';
|
||||
import '../features/add_transaction/screen.dart';
|
||||
import '../features/categories/screen.dart';
|
||||
import '../features/settings/screen.dart';
|
||||
import '../features/splash/screen.dart';
|
||||
import '../shared/models/transaction.dart';
|
||||
|
||||
final _shellKey = GlobalKey<NavigatorState>();
|
||||
|
||||
final appRouter = GoRouter(
|
||||
initialLocation: '/dashboard',
|
||||
initialLocation: '/splash',
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/splash',
|
||||
builder: (context, state) => const SplashScreen(),
|
||||
),
|
||||
ShellRoute(
|
||||
navigatorKey: _shellKey,
|
||||
builder: (context, state, child) => AppShell(child: child),
|
||||
|
||||
@@ -514,6 +514,37 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 24),
|
||||
child: Center(
|
||||
child: RichText(
|
||||
textAlign: TextAlign.center,
|
||||
text: const TextSpan(
|
||||
style: TextStyle(fontSize: 13, color: Colors.white30),
|
||||
children: [
|
||||
TextSpan(
|
||||
text: 'casha',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white38,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: ' powered with ❤️ by ',
|
||||
style: TextStyle(fontStyle: FontStyle.italic),
|
||||
),
|
||||
TextSpan(
|
||||
text: 'kolo',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white38,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
class SplashScreen extends StatefulWidget {
|
||||
const SplashScreen({super.key});
|
||||
|
||||
@override
|
||||
State<SplashScreen> createState() => _SplashScreenState();
|
||||
}
|
||||
|
||||
class _SplashScreenState extends State<SplashScreen> with SingleTickerProviderStateMixin {
|
||||
late AnimationController _controller;
|
||||
late Animation<double> _animation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controller = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 1800),
|
||||
);
|
||||
|
||||
_animation = CurvedAnimation(
|
||||
parent: _controller,
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
|
||||
_controller.forward();
|
||||
|
||||
_controller.addStatusListener((status) {
|
||||
if (status == AnimationStatus.completed) {
|
||||
if (mounted) {
|
||||
context.go('/dashboard');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFF0F0F14),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Casha',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 42,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: const Color(0xFF7C6DED),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
SizedBox(
|
||||
width: 120,
|
||||
child: AnimatedBuilder(
|
||||
animation: _animation,
|
||||
builder: (context, child) {
|
||||
return LinearProgressIndicator(
|
||||
value: _animation.value,
|
||||
backgroundColor: Colors.white.withOpacity(0.1),
|
||||
valueColor: const AlwaysStoppedAnimation<Color>(Color(0xFF7C6DED)),
|
||||
minHeight: 2,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user