Newer
Older
import 'dart:core';
import 'dart:async';
import 'package:flutter/material.dart';
class SplashScreen extends StatefulWidget {
final dynamic navigateAfterFuture;
SplashScreen({this.navigateAfterFuture});
@override
_SplashScreenState createState() => _SplashScreenState();
}
class _SplashScreenState extends State<SplashScreen> {
@override
void initState() {
super.initState();
load();
}
load() async {
var newWidget = await widget.navigateAfterFuture();
// Show loader additional 2 seconds
Timer(
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
() {
Navigator.of(context).pushReplacement(new MaterialPageRoute(builder: (BuildContext context) => newWidget));
}
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: new InkWell(
child:new Stack(
fit: StackFit.expand,
children: <Widget>[
new Container(
decoration: new BoxDecoration(
color: Color(0xFFd51d32),
),
),
new Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
new Expanded(
flex: 2,
child: new Container(
child: new Image.asset('assets/images/vereign_logo_text.png'),
padding: EdgeInsets.all(40)
),
),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
CircularProgressIndicator(
valueColor: new AlwaysStoppedAnimation<Color>(Colors.white),
),
Padding(
padding: const EdgeInsets.only(top: 20.0),
),
new Text('Loading', style: new TextStyle(
color: Colors.white
))
],
),
),
],
),
],
),
),
);
}
}