null_safety
小赖 4 years ago
parent a9de4679f1
commit 8dd8bebcb8

@ -7,9 +7,11 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
/// ///
///made with Scaffold from `Material` ///made with Scaffold from `Material`
/// ///
///`title`,`body`
/// ///
///`leading`,`bottomNavigationBar`,`appBarBottom` ///
///`title`,`body`,`leading`,`bottomNavigationBar`,`appBarBottom`,`appBar`
///
///title AppBar `null`scaffoldAppBar
class ASScaffold extends StatefulWidget { class ASScaffold extends StatefulWidget {
///`String``Text` ///`String``Text`
final dynamic title; final dynamic title;
@ -55,25 +57,27 @@ class _ASScaffoldState extends State<ASScaffold> {
endDrawer: widget.endDrawer, endDrawer: widget.endDrawer,
backgroundColor: kBackgroundColor, backgroundColor: kBackgroundColor,
bottomNavigationBar: widget.bottomNavigationBar, bottomNavigationBar: widget.bottomNavigationBar,
appBar: widget.appBar ?? appBar: widget.title == null && widget.appBar == null
AppBar( ? null
brightness: Brightness.light, : widget.appBar ??
backgroundColor: kForegroundColor, AppBar(
elevation: 0, brightness: Brightness.light,
leading: widget.leading ?? ASBackButton(), backgroundColor: kForegroundColor,
centerTitle: true, elevation: 0,
title: DefaultTextStyle( leading: widget.leading ?? ASBackButton(),
style: TextStyle( centerTitle: true,
color: kTextColor, title: DefaultTextStyle(
fontSize: 18.sp, style: TextStyle(
fontWeight: FontWeight.bold, color: kTextColor,
fontSize: 18.sp,
fontWeight: FontWeight.bold,
),
child: widget.title is String
? Text(widget.title)
: widget.title ?? SizedBox(),
),
bottom: widget.appBarBottom,
), ),
child: widget.title is String
? Text(widget.title)
: widget.title ?? SizedBox(),
),
bottom: widget.appBarBottom,
),
body: widget.body, body: widget.body,
); );
} }

Loading…
Cancel
Save