172 lines
6.1 KiB
Dart
172 lines
6.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import '../../core/constants/app_colors.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
import '../map/map_view.dart';
|
|
import '../onboarding/onboarding_view.dart';
|
|
|
|
class SplashView extends StatefulWidget {
|
|
const SplashView({super.key});
|
|
|
|
@override
|
|
State<SplashView> createState() => _SplashViewState();
|
|
}
|
|
|
|
class _SplashViewState extends State<SplashView> with SingleTickerProviderStateMixin {
|
|
late AnimationController _animController;
|
|
late Animation<double> _scaleAnimation;
|
|
late Animation<double> _fadeAnimation;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_animController = AnimationController(
|
|
vsync: this,
|
|
duration: const Duration(milliseconds: 1500),
|
|
);
|
|
|
|
_scaleAnimation = Tween<double>(begin: 0.88, end: 1.0).animate(
|
|
CurvedAnimation(parent: _animController, curve: Curves.easeOutCubic),
|
|
);
|
|
|
|
_fadeAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
|
|
CurvedAnimation(parent: _animController, curve: Curves.easeIn),
|
|
);
|
|
|
|
_animController.forward();
|
|
|
|
Future.delayed(const Duration(milliseconds: 2800), () async {
|
|
if (mounted) {
|
|
final prefs = await SharedPreferences.getInstance();
|
|
final hasSeen = prefs.getBool('has_seen_onboarding') ?? false;
|
|
final targetWidget = hasSeen ? const MapView() : const OnboardingView();
|
|
|
|
if (mounted) {
|
|
Navigator.of(context).pushReplacement(
|
|
PageRouteBuilder(
|
|
pageBuilder: (context, anim, secAnim) => targetWidget,
|
|
transitionsBuilder: (context, animation, secAnim, child) =>
|
|
FadeTransition(opacity: animation, child: child),
|
|
transitionDuration: const Duration(milliseconds: 600),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
_animController.dispose();
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: AppColors.canvasLight,
|
|
body: Center(
|
|
child: FadeTransition(
|
|
opacity: _fadeAnimation,
|
|
child: ScaleTransition(
|
|
scale: _scaleAnimation,
|
|
child: SingleChildScrollView(
|
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
// Luxury Siro Maps Emblem Container
|
|
Container(
|
|
width: 116,
|
|
height: 116,
|
|
decoration: BoxDecoration(
|
|
color: const Color(0xFF131722),
|
|
borderRadius: BorderRadius.circular(32),
|
|
border: Border.all(
|
|
color: AppColors.appleBlue.withValues(alpha: 0.35),
|
|
width: 1.5,
|
|
),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: AppColors.appleBlue.withValues(alpha: 0.18),
|
|
blurRadius: 36,
|
|
offset: const Offset(0, 14),
|
|
),
|
|
const BoxShadow(
|
|
color: Color(0x24000000),
|
|
blurRadius: 20,
|
|
offset: Offset(0, 6),
|
|
),
|
|
],
|
|
),
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.circular(30),
|
|
child: Image.asset(
|
|
'assets/images/siro_maps_logo.png',
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
),
|
|
const SizedBox(height: 24),
|
|
// App Title
|
|
Text(
|
|
'خرائط سيرو',
|
|
style: GoogleFonts.alexandria(
|
|
fontSize: 28,
|
|
fontWeight: FontWeight.w800,
|
|
color: AppColors.textPrimary,
|
|
letterSpacing: -0.5,
|
|
),
|
|
),
|
|
const SizedBox(height: 6),
|
|
// Subtitle
|
|
Text(
|
|
'Siro Map • منظومة الخرائط والملاحة الذكية',
|
|
style: GoogleFonts.alexandria(
|
|
fontSize: 13,
|
|
fontWeight: FontWeight.w600,
|
|
color: AppColors.textSecondary,
|
|
),
|
|
),
|
|
const SizedBox(height: 28),
|
|
// Regional Sovereignty Pill Badge
|
|
Container(
|
|
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 6),
|
|
decoration: BoxDecoration(
|
|
color: AppColors.surfaceMuted,
|
|
borderRadius: BorderRadius.circular(20),
|
|
border: Border.all(color: AppColors.borderSubtle),
|
|
),
|
|
child: Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Container(
|
|
width: 7,
|
|
height: 7,
|
|
decoration: const BoxDecoration(
|
|
color: AppColors.tacticalEmerald,
|
|
shape: BoxShape.circle,
|
|
),
|
|
),
|
|
const SizedBox(width: 8),
|
|
Text(
|
|
'🌍 شبكة ملاحة إقليمية مستقلة • v2.4 PRO',
|
|
style: GoogleFonts.alexandria(
|
|
fontSize: 11,
|
|
fontWeight: FontWeight.w600,
|
|
color: AppColors.textSecondary,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|