-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsplash_screen.dart
52 lines (41 loc) · 1013 Bytes
/
splash_screen.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import 'package:edubot/login_screen.dart';
import 'package:flutter/material.dart';
class splashScreen extends StatefulWidget {
const splashScreen({super.key});
@override
State<splashScreen> createState() => _splashScreenState();
}
class _splashScreenState extends State<splashScreen> {
@override
void initState() {
gotoLogin();
super.initState();
}
@override
void didChangeDependencies() {
// TODO: implement didChangeDependencies
super.didChangeDependencies();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
body: Center(
child: Image.asset('assets/icon.png'),
),
);
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
}
Future<void> gotoLogin() async{
await Future.delayed(Duration(seconds: 3));
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (ctx)=> LoginPage(),
),
);
}
}