完成scaffold

null_safety
小赖 4 years ago
parent 76c7893f74
commit ecd66ed121

@ -9,7 +9,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
/// ///
///`title`,`body` ///`title`,`body`
/// ///
///`leading` ///`leading`,`bottomNavigationBar`,`appBarBottom`
class ASScaffold extends StatefulWidget { class ASScaffold extends StatefulWidget {
///`String``Text` ///`String``Text`
final dynamic title; final dynamic title;
@ -19,11 +19,19 @@ class ASScaffold extends StatefulWidget {
/// `Scaffold` leading /// `Scaffold` leading
final Widget leading; final Widget leading;
/// `Scaffold` bottomNavigationBar
final Widget bottomNavigationBar;
/// `AppBar` appBarBottom
final PreferredSizeWidget appBarBottom;
ASScaffold({ ASScaffold({
Key key, Key key,
@required this.title, @required this.title,
this.leading, this.leading,
this.body, this.body,
this.bottomNavigationBar,
this.appBarBottom,
}) : super(key: key); }) : super(key: key);
@override @override
@ -35,6 +43,7 @@ class _ASScaffoldState extends State<ASScaffold> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: kBackgroundColor, backgroundColor: kBackgroundColor,
bottomNavigationBar: widget.bottomNavigationBar,
appBar: AppBar( appBar: AppBar(
backgroundColor: kForegroundColor, backgroundColor: kForegroundColor,
elevation: 0, elevation: 0,
@ -48,6 +57,7 @@ class _ASScaffoldState extends State<ASScaffold> {
), ),
child: widget.title is String ? Text(widget.title) : widget.title, child: widget.title is String ? Text(widget.title) : widget.title,
), ),
bottom: widget.appBarBottom,
), ),
body: widget.body, body: widget.body,
); );

Loading…
Cancel
Save