forked from alexvasl/drifter_app
73 lines
1.8 KiB
Dart
73 lines
1.8 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:drifter/theme/app_colors.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/svg.dart';
|
|
|
|
import '../../utilities/assets.dart';
|
|
|
|
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) {
|
|
var isAndroid;
|
|
return Scaffold(
|
|
backgroundColor: AppColors.background,
|
|
body: Center(
|
|
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,
|
|
),
|
|
//replace with rotating drifter icon
|
|
if (Platform.isAndroid)
|
|
const CircularProgressIndicator(
|
|
color: AppColors.mainAccent,
|
|
)
|
|
else
|
|
const CupertinoActivityIndicator(
|
|
radius: 20,
|
|
)
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|