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,9 +114,7 @@ class _CommunityIndexState extends State<CommunityIndex>
return BeeScaffold(
title: '社区',
actions: _listActions(),
body: Stack(
children: [
Column(
body: Column(
children: [
Material(
color: kForeGroundColor,
@ -163,13 +160,7 @@ class _CommunityIndexState extends State<CommunityIndex>
// _floatingActionButton(),
],
),
Positioned(
right: 30.w,
bottom: 50.w,
child: _floatingActionButton(),
)
],
),
fab: _floatingActionButton(),
);
}
}

@ -22,8 +22,9 @@ class BeeScaffold extends StatefulWidget {
final Widget leading;
final Widget bottomNavi;
final PreferredSizeWidget appBarBottom;
BeeScaffold(
{Key key,
final FloatingActionButton fab;
BeeScaffold({
Key key,
@required this.title,
this.body,
this.actions,
@ -31,19 +32,21 @@ class BeeScaffold extends StatefulWidget {
this.bgColor = Colors.white,
this.bodyColor = const Color(0xFFF9F9F9),
this.bottomNavi,
this.appBarBottom})
: super(key: key);
this.appBarBottom,
this.fab,
}) : super(key: key);
BeeScaffold.white(
{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,
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