BasicScaffold constructor

BasicScaffold({
  1. Key? key,
  2. Widget? child,
  3. List<Widget>? children,
  4. MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
  5. CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
  6. Axis direction = Axis.vertical,
  7. bool safeLeft = false,
  8. bool safeTop = false,
  9. bool safeRight = false,
  10. bool safeBottom = false,
  11. bool isScroll = false,
  12. bool isStack = false,
  13. bool? resizeToAvoidBottomInset = false,
  14. EdgeInsetsGeometry? padding,
  15. Widget? bottomNavigationBar,
  16. Widget? endDrawer,
  17. Widget? floatingActionButton,
  18. FloatingActionButtonAnimator? floatingActionButtonAnimator,
  19. FloatingActionButtonLocation? floatingActionButtonLocation,
  20. bool onWillPopOverlayClose = false,
  21. Decoration? decoration,
  22. bool useSingleChildScrollView = true,
  23. EdgeInsetsGeometry? margin,
  24. Widget? bottomSheet,
  25. Widget? drawer,
  26. DragStartBehavior drawerDragStartBehavior = DragStartBehavior.start,
  27. double? drawerEdgeDragWidth,
  28. bool drawerEnableOpenDragGesture = true,
  29. Color? drawerScrimColor,
  30. bool endDrawerEnableOpenDragGesture = true,
  31. DrawerCallback? onDrawerChanged,
  32. DrawerCallback? onEndDrawerChanged,
  33. bool extendBody = false,
  34. bool extendBodyBehindAppBar = false,
  35. AlignmentDirectional persistentFooterAlignment = AlignmentDirectional.centerEnd,
  36. List<Widget>? persistentFooterButtons,
  37. bool primary = true,
  38. String? restorationId,
  39. Color? backgroundColor,
  40. bool isRootPage = false,
  41. WillPopCallback? onWillPop,
  42. VoidCallback? onRefresh,
  43. VoidCallback? onLoading,
  44. double? appBarHeight,
  45. Widget? appBar,
  46. double? elevation,
  47. Widget? appBarTitle,
  48. String? appBarTitleText,
  49. Widget? appBarAction,
  50. List<Widget>? appBarActions,
  51. Widget? appBarLeading,
  52. double? leadingWidth,
  53. Color? appBarBackgroundColor,
  54. Color? appBarForegroundColor,
  55. bool appBarPrimary = true,
  56. PreferredSizeWidget? appBarBottom,
  57. IconThemeData? appBarIconTheme,
  58. bool isMaybePop = false,
  59. bool enableLeading = true,
  60. SystemUiOverlayStyle? systemOverlayStyle,
  61. bool centerTitle = true,
  62. IconThemeData? actionsIconTheme,
  63. bool automaticallyImplyLeading = true,
  64. bool excludeHeaderSemantics = true,
  65. double bottomOpacity = 1.0,
  66. Widget? flexibleSpace,
  67. ScrollNotificationPredicate notificationPredicate = defaultScrollNotificationPredicate,
  68. double? scrolledUnderElevation,
  69. Color? shadowColor,
  70. ShapeBorder? shape,
  71. Color? surfaceTintColor,
  72. double? titleSpacing,
  73. TextStyle? titleTextStyle,
  74. double? toolbarHeight,
  75. double toolbarOpacity = 1.0,
  76. TextStyle? toolbarTextStyle,
})

Implementation

BasicScaffold({
  super.key,
  Widget? child,

  /// [children].length > 0 [child] invalid
  super.children,

  /// [children].length > 0 && [isStack]=false invalid;
  super.mainAxisAlignment = MainAxisAlignment.start,

  /// [children].length > 0 && [isStack]=false invalid;
  super.crossAxisAlignment = CrossAxisAlignment.center,

  /// [children].length > 0 && [isStack]=false invalid;
  super.direction = Axis.vertical,
  super.safeLeft = false,
  super.safeTop = false,
  super.safeRight = false,
  super.safeBottom = false,
  super.isScroll = false,
  super.isStack = false,
  super.resizeToAvoidBottomInset = false,
  super.padding,
  super.bottomNavigationBar,
  super.endDrawer,
  super.floatingActionButton,
  super.floatingActionButtonAnimator,
  super.floatingActionButtonLocation,
  super.onWillPopOverlayClose = false,
  super.decoration,
  super.useSingleChildScrollView = true,
  super.margin,
  super.bottomSheet,
  super.drawer,
  super.drawerDragStartBehavior = DragStartBehavior.start,
  super.drawerEdgeDragWidth,
  super.drawerEnableOpenDragGesture = true,
  super.drawerScrimColor,
  super.endDrawerEnableOpenDragGesture = true,
  super.onDrawerChanged,
  super.onEndDrawerChanged,
  super.extendBody = false,
  super.extendBodyBehindAppBar = false,
  super.persistentFooterAlignment = AlignmentDirectional.centerEnd,
  super.persistentFooterButtons,
  super.primary = true,
  super.restorationId,
  Color? backgroundColor,
  bool isRootPage = false,
  WillPopCallback? onWillPop,
  VoidCallback? onRefresh,
  VoidCallback? onLoading,

  /// [AppBar]
  super.appBarHeight,
  Widget? appBar,
  double? elevation,
  Widget? appBarTitle,
  String? appBarTitleText,
  Widget? appBarAction,
  List<Widget>? appBarActions,
  Widget? appBarLeading,
  double? leadingWidth,
  Color? appBarBackgroundColor,
  Color? appBarForegroundColor,
  bool appBarPrimary = true,
  PreferredSizeWidget? appBarBottom,
  IconThemeData? appBarIconTheme,
  bool isMaybePop = false,
  bool enableLeading = true,
  SystemUiOverlayStyle? systemOverlayStyle,
  bool centerTitle = true,
  IconThemeData? actionsIconTheme,
  bool automaticallyImplyLeading = true,
  bool excludeHeaderSemantics = true,
  double bottomOpacity = 1.0,
  Widget? flexibleSpace,
  ScrollNotificationPredicate notificationPredicate =
      defaultScrollNotificationPredicate,
  double? scrolledUnderElevation,
  Color? shadowColor,
  ShapeBorder? shape,
  Color? surfaceTintColor,
  double? titleSpacing,
  TextStyle? titleTextStyle,
  double? toolbarHeight,
  double toolbarOpacity = 1.0,
  TextStyle? toolbarTextStyle,
}) : super(
          onWillPop: onWillPop ?? _isRootPageWithWillPop(isRootPage),
          backgroundColor:
              backgroundColor ?? GlobalConfig().config.scaffoldBackground,
          refreshConfig: (onRefresh != null || onLoading != null)
              ? RefreshConfig(
                  footer: GlobalConfig().config.pullUpFooter,
                  header: GlobalConfig().config.pullDownHeader,
                  onLoading:
                      onLoading == null ? null : () async => onLoading.call(),
                  onRefresh:
                      onRefresh == null ? null : () async => onRefresh.call())
              : null,
          body: child,
          appBar: appBar ??
              (appBarTitleText != null ||
                      appBarTitle != null ||
                      appBarBottom != null ||
                      appBarActions != null ||
                      appBarLeading != null ||
                      appBarAction != null
                  ? BasicAppBar(
                      enableLeading: enableLeading,
                      actions: appBarActions,
                      isMaybePop: isMaybePop,
                      bottom: appBarBottom,
                      titleText: appBarTitleText,
                      title: appBarTitle,
                      elevation: elevation,
                      action: appBarAction,
                      leading: appBarLeading,
                      systemOverlayStyle: systemOverlayStyle,
                      backgroundColor: appBarBackgroundColor,
                      centerTitle: centerTitle,
                      iconTheme: appBarIconTheme,
                      actionsIconTheme: actionsIconTheme,
                      automaticallyImplyLeading: automaticallyImplyLeading,
                      bottomOpacity: bottomOpacity,
                      excludeHeaderSemantics: excludeHeaderSemantics,
                      flexibleSpace: flexibleSpace,
                      leadingWidth: leadingWidth,
                      notificationPredicate: notificationPredicate,
                      primary: appBarPrimary,
                      scrolledUnderElevation: scrolledUnderElevation,
                      shadowColor: shadowColor,
                      foregroundColor: appBarForegroundColor,
                      shape: shape,
                      surfaceTintColor: surfaceTintColor,
                      titleSpacing: titleSpacing,
                      titleTextStyle: titleTextStyle,
                      toolbarHeight: toolbarHeight,
                      toolbarOpacity: toolbarOpacity,
                      toolbarTextStyle: toolbarTextStyle)
                  : null));