diff --git a/lib/pages/personal/personal_page.dart b/lib/pages/personal/personal_page.dart index 93f66453..bb81148e 100644 --- a/lib/pages/personal/personal_page.dart +++ b/lib/pages/personal/personal_page.dart @@ -13,7 +13,8 @@ import 'package:akuCommunity/routers/page_routers.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class PersonalIndex extends StatefulWidget { - PersonalIndex({Key key}) : super(key: key); + final bool isSign; + PersonalIndex({Key key, this.isSign}) : super(key: key); @override _PersonalIndexState createState() => _PersonalIndexState(); @@ -24,7 +25,12 @@ class _PersonalIndexState extends State @override bool get wantKeepAlive => true; - bool _isSigned = false; + bool _isSigned=false; + @override + void initState() { + super.initState(); + _isSigned=widget.isSign; + } SliverAppBar _sliverAppBar(double height) { return SliverAppBar( diff --git a/lib/pages/sign/user_authentication_page.dart b/lib/pages/sign/user_authentication_page.dart index ad7a414d..1ee5f43f 100644 --- a/lib/pages/sign/user_authentication_page.dart +++ b/lib/pages/sign/user_authentication_page.dart @@ -39,8 +39,8 @@ class _UserAuthenticationPageState extends State { MaterialButton( child: Text('跳过'), onPressed: () { - ARoute.pop(context); - ARoute.pushReplace(context, TabNavigator()); + ARoute.pop(context,root: true); + ARoute.pushReplace(context, TabNavigator(isSign: true,)); }, ), ], diff --git a/lib/pages/tab_navigator.dart b/lib/pages/tab_navigator.dart index 51d1fc97..5cece989 100644 --- a/lib/pages/tab_navigator.dart +++ b/lib/pages/tab_navigator.dart @@ -9,16 +9,11 @@ import 'property/property_index.dart'; import 'community/community_index.dart'; import 'personal/personal_page.dart'; -//页面列表 -List _pages = [ - HomePage(), - MarketPage(), - PropertyIndex(), - CommunityIndex(), - PersonalIndex() -]; class TabNavigator extends StatefulWidget { + final bool isSign; + + const TabNavigator({Key key, this.isSign=false}) : super(key: key); @override _TabNavigatorState createState() => _TabNavigatorState(); } @@ -28,9 +23,23 @@ class _TabNavigatorState extends State { int _currentIndex = 0; DateTime _lastPressed; + //页面列表 +List _pages = [ +]; + @override void initState() { super.initState(); +_pages=[ + + HomePage(), + MarketPage(), + PropertyIndex(), + CommunityIndex(), + PersonalIndex( + isSign: widget.isSign, + ) +]; } @override