11import 'dart:async' ;
22
33import 'package:flutter/material.dart' ;
4+ import 'package:flutter_lottie/flutter_lottie.dart' ;
45import 'package:flutter_redux/flutter_redux.dart' ;
56import 'package:gsy_github_app_flutter/common/dao/user_dao.dart' ;
67import 'package:gsy_github_app_flutter/common/redux/gsy_state.dart' ;
@@ -22,21 +23,21 @@ class WelcomePage extends StatefulWidget {
2223 _WelcomePageState createState () => _WelcomePageState ();
2324}
2425
25- class _WelcomePageState extends State <WelcomePage > {
26-
26+ class _WelcomePageState extends State <WelcomePage > {
2727 bool hadInit = false ;
2828
2929 @override
3030 void didChangeDependencies () {
3131 super .didChangeDependencies ();
32- if (hadInit) {
32+ if (hadInit) {
3333 return ;
3434 }
3535 hadInit = true ;
36+
3637 ///防止多次进入
3738 Store <GSYState > store = StoreProvider .of (context);
3839 CommonUtils .initStatusBarHeight (context);
39- new Future .delayed (const Duration (seconds: 2 ), () {
40+ new Future .delayed (const Duration (seconds: 2 , milliseconds : 500 ), () {
4041 UserDao .initUserInfo (store).then ((res) {
4142 if (res != null && res.result) {
4243 NavigatorUtils .goHome (context);
@@ -48,18 +49,42 @@ class _WelcomePageState extends State<WelcomePage> {
4849 });
4950 }
5051
52+ void onViewCreatedFile (LottieController controller) {
53+
54+ }
55+
5156 @override
5257 Widget build (BuildContext context) {
5358 return StoreBuilder <GSYState >(
5459 builder: (context, store) {
60+ double size = 200 ;
5561 return new Container (
5662 color: Color (GSYColors .white),
57- child: new Center (
58- child: new Image (image: new AssetImage ('static/images/welcome.png' )),
63+ child: Stack (
64+ children: < Widget > [
65+ new Center (
66+ child: new Image (
67+ image: new AssetImage ('static/images/welcome.png' )),
68+ ),
69+ new Align (
70+ alignment: Alignment .bottomCenter,
71+ child: new Container (
72+ width: size,
73+ height: size,
74+ color: Colors .white,
75+ child: LottieView .fromFile (
76+ filePath: "static/file/rejection2.json" ,
77+ autoPlay: true ,
78+ loop: true ,
79+ reverse: false ,
80+ onViewCreated: onViewCreatedFile,
81+ ),
82+ ),
83+ )
84+ ],
5985 ),
6086 );
6187 },
6288 );
6389 }
64-
6590}
0 commit comments