fix when title null

null_safety
小赖 4 years ago
parent 8d08e187e8
commit a9de4679f1

@ -7,7 +7,7 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "0.0.2" version: "0.0.3"
async: async:
dependency: transitive dependency: transitive
description: description:

@ -35,7 +35,7 @@ class ASScaffold extends StatefulWidget {
final Widget appBar; final Widget appBar;
ASScaffold({ ASScaffold({
Key key, Key key,
@required this.title, this.title,
this.leading, this.leading,
this.body, this.body,
this.bottomNavigationBar, this.bottomNavigationBar,
@ -68,7 +68,9 @@ class _ASScaffoldState extends State<ASScaffold> {
fontSize: 18.sp, fontSize: 18.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
child: widget.title is String ? Text(widget.title) : widget.title, child: widget.title is String
? Text(widget.title)
: widget.title ?? SizedBox(),
), ),
bottom: widget.appBarBottom, bottom: widget.appBarBottom,
), ),

Loading…
Cancel
Save