diff --git a/lib/pages/community/community_index.dart b/lib/pages/community/community_index.dart index b507052a..83713e91 100644 --- a/lib/pages/community/community_index.dart +++ b/lib/pages/community/community_index.dart @@ -103,7 +103,6 @@ class _CommunityIndexState extends State child: Icon( Icons.add, color: Colors.white, - size: 40.sp, ), onPressed: noteCreateRouter, ); @@ -115,61 +114,53 @@ class _CommunityIndexState extends State return BeeScaffold( title: '社区', actions: _listActions(), - body: Stack( + body: Column( children: [ - Column( - children: [ - Material( - color: kForeGroundColor, - child: PreferredSize( - preferredSize: Size.fromHeight(kToolbarHeight), - child: Align( - alignment: Alignment.centerLeft, - child: TabBar( - indicatorPadding: EdgeInsets.zero, - controller: _tabController, - isScrollable: true, - indicatorColor: Color(0xffFFd000), - indicatorWeight: 2.w, - indicatorSize: TabBarIndicatorSize.label, - unselectedLabelStyle: TextStyle( - color: Color(0xFF333333), - fontSize: 28.sp, - ), - labelStyle: TextStyle( - fontSize: 28.sp, - color: Color(0xff333333), - fontWeight: FontWeight.bold, - ), - tabs: List.generate( - tabs.length, - (index) => Tab( - text: tabs[index]['name'], - ), - ), - ), - ), - ), - ), - Expanded( - child: TabBarView( + Material( + color: kForeGroundColor, + child: PreferredSize( + preferredSize: Size.fromHeight(kToolbarHeight), + child: Align( + alignment: Alignment.centerLeft, + child: TabBar( + indicatorPadding: EdgeInsets.zero, controller: _tabController, - children: List.generate( + isScrollable: true, + indicatorColor: Color(0xffFFd000), + indicatorWeight: 2.w, + indicatorSize: TabBarIndicatorSize.label, + unselectedLabelStyle: TextStyle( + color: Color(0xFF333333), + fontSize: 28.sp, + ), + labelStyle: TextStyle( + fontSize: 28.sp, + color: Color(0xff333333), + fontWeight: FontWeight.bold, + ), + tabs: List.generate( tabs.length, - (index) => TabList(index: index), + (index) => Tab( + text: tabs[index]['name'], + ), ), ), ), - // _floatingActionButton(), - ], + ), + ), + Expanded( + child: TabBarView( + controller: _tabController, + children: List.generate( + tabs.length, + (index) => TabList(index: index), + ), + ), ), - Positioned( - right: 30.w, - bottom: 50.w, - child: _floatingActionButton(), - ) + // _floatingActionButton(), ], ), + fab: _floatingActionButton(), ); } } diff --git a/lib/widget/bee_scaffold.dart b/lib/widget/bee_scaffold.dart index df31eb0a..686c5f82 100644 --- a/lib/widget/bee_scaffold.dart +++ b/lib/widget/bee_scaffold.dart @@ -22,28 +22,31 @@ class BeeScaffold extends StatefulWidget { final Widget leading; final Widget bottomNavi; final PreferredSizeWidget appBarBottom; - BeeScaffold( - {Key key, - @required this.title, - this.body, - this.actions, - this.leading, - this.bgColor = Colors.white, - this.bodyColor = const Color(0xFFF9F9F9), - this.bottomNavi, - this.appBarBottom}) - : super(key: key); + final FloatingActionButton fab; + BeeScaffold({ + Key key, + @required this.title, + this.body, + this.actions, + this.leading, + this.bgColor = Colors.white, + this.bodyColor = const Color(0xFFF9F9F9), + this.bottomNavi, + this.appBarBottom, + this.fab, + }) : super(key: key); - BeeScaffold.white( - {Key key, - @required this.title, - this.body, - this.actions, - this.leading, - this.bgColor = Colors.white, - this.bottomNavi, - this.appBarBottom}) - : this.bodyColor = Colors.white, + BeeScaffold.white({ + Key key, + @required this.title, + this.body, + this.actions, + this.leading, + this.bgColor = Colors.white, + this.bottomNavi, + this.appBarBottom, + this.fab, + }) : this.bodyColor = Colors.white, super(key: key); @override @@ -67,6 +70,7 @@ class _BeeScaffoldState extends State { ), body: widget.body, bottomNavigationBar: widget.bottomNavi, + floatingActionButton: widget.fab, ); } }