buildScaffoldWidget function
Widget
buildScaffoldWidget({
- required Widget body,
- Key? key,
- double? mToolBarHeight,
- Color? backgroundColor,
- Color? appBarBackColor,
- Widget? leading,
- bool useAppBar = true,
- bool automaticallyImplyLeading = true,
- TextStyle? textStyle,
- Widget? titleWidget,
- double? hMargin,
- double? titleTextSize,
- FontWeight? fontWeight,
- bool centerTitle = true,
- String title = '',
- double? titleSpacing,
- EdgeInsets? padding,
- double? leadingWidth,
- PreferredSizeWidget? bottom,
- bool useSafeArea = true,
- List<
Widget> ? actions, - bool resizeToAvoidBottomInset = false,
- PreferredSize? appBar,
- IconThemeData? iconTheme,
获取SafeArea的布局
Implementation
Widget buildScaffoldWidget({
required Widget body,
Key? key,
double? mToolBarHeight,
Color? backgroundColor,
Color? appBarBackColor,
Widget? leading,
bool useAppBar = true,
bool automaticallyImplyLeading = true,
TextStyle? textStyle,
Widget? titleWidget,
double? hMargin,
double? titleTextSize,
FontWeight? fontWeight,
bool centerTitle = true,
String title = '',
double? titleSpacing,
EdgeInsets? padding,
Widget? bottomNavigationBar,
double? leadingWidth,
PreferredSizeWidget? bottom,
bool useSafeArea = true,
List<Widget>? actions,
bool resizeToAvoidBottomInset = false,
PreferredSize? appBar,
IconThemeData? iconTheme
}){
double mAppBarHeight = mToolBarHeight??appBarHeight;
return Scaffold(
key: key,
backgroundColor: backgroundColor,
appBar: useAppBar? appBar??buildAppBarWidget(
iconTheme: iconTheme,
toolbarHeight: mAppBarHeight,
leadingWidth: leadingWidth,
title: title,
automaticallyImplyLeading: automaticallyImplyLeading,
titleWidget: titleWidget,
fontWeight: fontWeight,
leading: leading,
titleSpacing: titleSpacing,
centerTitle: centerTitle,
textStyle: textStyle,
backgroundColor: appBarBackColor,
bottom: bottom,
actions: actions
): null,
resizeToAvoidBottomInset: resizeToAvoidBottomInset,
bottomNavigationBar: bottomNavigationBar,
body: useSafeArea? SafeArea(
child: Padding(
padding: padding??getEdgeInsetsAll(0),
child: body,
),
) : Padding(
padding: padding??getEdgeInsetsAll(0),
child: body,
),
);
}