buildScaffoldWidget function

Widget buildScaffoldWidget({
  1. required Widget body,
  2. Key? key,
  3. double? mToolBarHeight,
  4. Color? backgroundColor,
  5. Color? appBarBackColor,
  6. Widget? leading,
  7. bool useAppBar = true,
  8. bool automaticallyImplyLeading = true,
  9. TextStyle? textStyle,
  10. Widget? titleWidget,
  11. double? hMargin,
  12. double? titleTextSize,
  13. FontWeight? fontWeight,
  14. bool centerTitle = true,
  15. String title = '',
  16. double? titleSpacing,
  17. EdgeInsets? padding,
  18. Widget? bottomNavigationBar,
  19. double? leadingWidth,
  20. PreferredSizeWidget? bottom,
  21. bool useSafeArea = true,
  22. List<Widget>? actions,
  23. bool resizeToAvoidBottomInset = false,
  24. PreferredSize? appBar,
  25. 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,
    ),
  );
}