File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed
Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ import 'dart:async' ;
2+
3+ import 'package:flutter/material.dart' ;
4+ import 'package:text_to_image_gen/Pages/home_page.dart' ;
5+
6+ class SplashScreen extends StatefulWidget {
7+ const SplashScreen ({super .key});
8+
9+ @override
10+ _SplashScreenState createState () => _SplashScreenState ();
11+ }
12+
13+ class _SplashScreenState extends State <SplashScreen > {
14+ @override
15+ void initState () {
16+ // TODO: implement initState
17+ super .initState ();
18+ Timer (
19+ const Duration (seconds: 4 ),
20+ () {
21+ Navigator .of (context).pushReplacement (
22+ MaterialPageRoute (builder: (_) => const HomePage ()));
23+ },
24+ );
25+ }
26+
27+ @override
28+ Widget build (BuildContext context) {
29+ return Scaffold (
30+ backgroundColor: Colors .deepPurple.shade50,
31+ body: Center (
32+ child: Column (
33+ mainAxisAlignment: MainAxisAlignment .center,
34+ children: [
35+ // logo here
36+ Image .asset (
37+ 'assets/images/TexFusion.png' ,
38+ height: 150 ,
39+ ),
40+ const SizedBox (
41+ height: 20 ,
42+ ),
43+ const CircularProgressIndicator (
44+ valueColor: AlwaysStoppedAnimation <Color >(Colors .deepPurple),
45+ ),
46+ ],
47+ ),
48+ ),
49+ );
50+ }
51+ }
You can’t perform that action at this time.
0 commit comments