TKK_E32222503/lib/pages/splashScreen.dart

62 lines
1.4 KiB
Dart

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:incubator_app/components/button_navigation.dart';
import 'package:incubator_app/pages/beranda.dart';
class SplashScreen extends StatefulWidget {
const SplashScreen({super.key});
@override
State<SplashScreen> createState() => _SplashScreenState();
}
class _SplashScreenState extends State<SplashScreen> {
Timer? _timer;
@override
void initState() {
super.initState();
_timer = Timer(Duration(seconds: 3), () {
Get.to(() => ButtonNavigation());
});
}
@override
void dispose() {
super.dispose();
_timer?.cancel();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Image.asset(
'assets/image/icon_incubator_1.png',
width: 350,
height: 350,
),
SizedBox(height: 5),
CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.blue),
),
SizedBox(height: 20),
Text(
'Loading...',
style: TextStyle(
fontSize: 16,
color: Colors.black,
),
),
],
),
),
);
}
}