2023-05-12 17:28:36 +00:00
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
import 'package:drifter/theme/app_colors.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
2023-05-12 19:29:44 +00:00
|
|
|
import 'package:flutter_svg/svg.dart';
|
|
|
|
|
|
|
|
import '../../utilities/assets.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> {
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
Future.delayed(const Duration(seconds: 3), () {
|
|
|
|
Navigator.pushReplacement(context,
|
|
|
|
MaterialPageRoute(builder: (context) => const MainScreenWidget()));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2023-05-12 22:23:40 +00:00
|
|
|
var isAndroid;
|
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(
|
|
|
|
height: 250,
|
|
|
|
),
|
2023-05-12 22:23:40 +00:00
|
|
|
//replace with rotating drifter icon
|
2023-05-12 19:29:44 +00:00
|
|
|
if (Platform.isAndroid)
|
|
|
|
const CircularProgressIndicator(
|
|
|
|
color: AppColors.mainAccent,
|
|
|
|
)
|
|
|
|
else
|
|
|
|
const CupertinoActivityIndicator(
|
|
|
|
radius: 20,
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
2023-05-12 17:28:36 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|