File tree Expand file tree Collapse file tree 4 files changed +25
-2
lines changed Expand file tree Collapse file tree 4 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ class _LoginPageState extends State<LoginPage> {
109109 if (res != null && res.result) {
110110 new Future .delayed (const Duration (seconds: 1 ), () {
111111 NavigatorUtils .goHome (context);
112+ return true ;
112113 });
113114 }
114115 });
Original file line number Diff line number Diff line change @@ -14,11 +14,26 @@ import 'package:redux/redux.dart';
1414 * Created by guoshuyu
1515 * Date: 2018-07-16
1616 */
17- class WelcomePage extends StatelessWidget {
17+
18+ class WelcomePage extends StatefulWidget {
1819 static final String sName = "/" ;
1920
2021 @override
21- Widget build (BuildContext context) {
22+ _WelcomePageState createState () => _WelcomePageState ();
23+ }
24+
25+ class _WelcomePageState extends State <WelcomePage > {
26+
27+ bool hadInit = false ;
28+
29+ @override
30+ void didChangeDependencies () {
31+ super .didChangeDependencies ();
32+ if (hadInit) {
33+ return ;
34+ }
35+ hadInit = true ;
36+ ///防止多次进入
2237 Store <GSYState > store = StoreProvider .of (context);
2338 CommonUtils .initStatusBarHeight (context);
2439 new Future .delayed (const Duration (seconds: 2 ), () {
@@ -31,6 +46,10 @@ class WelcomePage extends StatelessWidget {
3146 return true ;
3247 });
3348 });
49+ }
50+
51+ @override
52+ Widget build (BuildContext context) {
3453 return StoreBuilder <GSYState >(
3554 builder: (context, store) {
3655 return new Container (
@@ -42,4 +61,5 @@ class WelcomePage extends StatelessWidget {
4261 },
4362 );
4463 }
64+
4565}
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ class _DemoStateWidgetState extends State<DemoStateWidget> with AutomaticKeepAli
5555 setState (() {
5656 text = "这就变了数值" ;
5757 });
58+ return true ;
5859 });
5960 }
6061
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ abstract class GSYListState<T extends StatefulWidget> extends State<T> with Auto
2626 showRefreshLoading () {
2727 new Future .delayed (const Duration (seconds: 0 ), () {
2828 refreshIndicatorKey.currentState.show ().then ((e) {});
29+ return true ;
2930 });
3031 }
3132
You can’t perform that action at this time.
0 commit comments