fix appBar height

null_safety
小赖 5 years ago
parent d52ac279c3
commit 1d5c169e43

@ -11,7 +11,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
/// ///
///`title`,`body`,`leading`,`bottomNavigationBar`,`appBarBottom`,`appBar` ///`title`,`body`,`leading`,`bottomNavigationBar`,`appBarBottom`,`appBar`
/// ///
///title AppBar `null`scaffoldAppBar ///title , AppBar AppBarBottom `null`scaffoldAppBar
///
///AppBarBottomAppBarBottom
class ASScaffold extends StatefulWidget { class ASScaffold extends StatefulWidget {
///`String``Text` ///`String``Text`
final dynamic title; final dynamic title;
@ -57,13 +59,18 @@ class _ASScaffoldState extends State<ASScaffold> {
endDrawer: widget.endDrawer, endDrawer: widget.endDrawer,
backgroundColor: kBackgroundColor, backgroundColor: kBackgroundColor,
bottomNavigationBar: widget.bottomNavigationBar, bottomNavigationBar: widget.bottomNavigationBar,
appBar: widget.title == null && widget.appBar == null appBar: widget.title == null &&
widget.appBar == null &&
widget.appBarBottom == null
? null ? null
: widget.appBar ?? : widget.appBar ??
AppBar( AppBar(
brightness: Brightness.light, brightness: Brightness.light,
backgroundColor: kForegroundColor, backgroundColor: kForegroundColor,
elevation: 0, elevation: 0,
toolbarHeight: widget.title == null && widget.appBar == null
? widget.appBarBottom.preferredSize.height + 2.0
: null,
leading: widget.leading ?? ASBackButton(), leading: widget.leading ?? ASBackButton(),
centerTitle: true, centerTitle: true,
title: DefaultTextStyle( title: DefaultTextStyle(

Loading…
Cancel
Save