2023-05-15 15:55:49 +00:00
|
|
|
import 'package:drifter/pages/main_screen/main_screen_widget.dart';
|
2023-05-15 20:32:54 +00:00
|
|
|
import 'package:drifter/pages/widgets/animated_widgets/rotate_icon.dart';
|
2023-05-12 17:28:36 +00:00
|
|
|
import 'package:drifter/theme/app_colors.dart';
|
2023-05-15 20:32:54 +00:00
|
|
|
import 'package:drifter/utilities/assets.dart';
|
2023-05-12 17:28:36 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2023-05-12 19:29:44 +00:00
|
|
|
import 'package:flutter_svg/svg.dart';
|
|
|
|
|
2023-05-12 17:28:36 +00:00
|
|
|
class Splash extends StatefulWidget {
|
|
|
|
const Splash({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<Splash> createState() => _SplashState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _SplashState extends State<Splash> {
|
2023-05-15 15:55:49 +00:00
|
|
|
late final RotateIconController _rotateIconController;
|
|
|
|
|
2023-05-12 17:28:36 +00:00
|
|
|
@override
|
|
|
|
void initState() {
|
2023-05-15 15:55:49 +00:00
|
|
|
_rotateIconController = RotateIconController();
|
|
|
|
|
2023-05-12 17:28:36 +00:00
|
|
|
Future.delayed(const Duration(seconds: 3), () {
|
|
|
|
Navigator.pushReplacement(context,
|
|
|
|
MaterialPageRoute(builder: (context) => const MainScreenWidget()));
|
|
|
|
});
|
2023-05-15 15:55:49 +00:00
|
|
|
|
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
dispose() {
|
|
|
|
_rotateIconController.repeat = null;
|
|
|
|
_rotateIconController.reset = null;
|
|
|
|
|
|
|
|
super.dispose();
|
2023-05-12 17:28:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2023-05-15 15:55:49 +00:00
|
|
|
_rotateIconController.reset?.call();
|
|
|
|
_rotateIconController.repeat?.call();
|
|
|
|
|
2023-05-12 17:28:36 +00:00
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: AppColors.background,
|
|
|
|
body: Center(
|
2023-05-12 19:29:44 +00:00
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
const SizedBox(
|
|
|
|
height: 200,
|
|
|
|
),
|
|
|
|
SvgPicture.asset(
|
|
|
|
Assets.svg.drifterIcon,
|
|
|
|
height: 150,
|
|
|
|
width: 150,
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
height: 10,
|
|
|
|
),
|
|
|
|
const Text(
|
|
|
|
"Drifter",
|
|
|
|
style: TextStyle(
|
|
|
|
color: AppColors.mainAccent,
|
|
|
|
fontSize: 50,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
2023-05-15 15:55:49 +00:00
|
|
|
height: 230,
|
2023-05-12 19:29:44 +00:00
|
|
|
),
|
2023-05-12 22:23:40 +00:00
|
|
|
//replace with rotating drifter icon
|
2023-05-15 15:55:49 +00:00
|
|
|
RotateIcon(
|
|
|
|
icon: SvgPicture.asset(
|
|
|
|
Assets.svg.drifterIcon,
|
|
|
|
height: 45,
|
|
|
|
width: 45,
|
|
|
|
),
|
|
|
|
curve: Curves.easeInOutSine,
|
|
|
|
animationDurationMultiplier: 1.2,
|
|
|
|
rotationPercent: 1.0,
|
|
|
|
controller: _rotateIconController,
|
|
|
|
),
|
2023-05-12 19:29:44 +00:00
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
2023-05-12 17:28:36 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|