BeeScaffold add FAB option

hmxc
小赖 4 years ago
parent 707950a1f2
commit 932648a707

@ -103,7 +103,6 @@ class _CommunityIndexState extends State<CommunityIndex>
child: Icon(
Icons.add,
color: Colors.white,
size: 40.sp,
),
onPressed: noteCreateRouter,
);
@ -115,61 +114,53 @@ class _CommunityIndexState extends State<CommunityIndex>
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(),
);
}
}

@ -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<BeeScaffold> {
),
body: widget.body,
bottomNavigationBar: widget.bottomNavi,
floatingActionButton: widget.fab,
);
}
}

Loading…
Cancel
Save