BasicScaffold constructor
BasicScaffold({
- Key? key,
- Widget? child,
- List<
Widget> ? children, - MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
- CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
- Axis direction = Axis.vertical,
- bool safeLeft = false,
- bool safeTop = false,
- bool safeRight = false,
- bool safeBottom = false,
- bool isScroll = false,
- bool isStack = false,
- bool? resizeToAvoidBottomInset = false,
- EdgeInsetsGeometry? padding,
- Widget? endDrawer,
- Widget? floatingActionButton,
- FloatingActionButtonAnimator? floatingActionButtonAnimator,
- FloatingActionButtonLocation? floatingActionButtonLocation,
- bool onWillPopOverlayClose = false,
- Decoration? decoration,
- bool useSingleChildScrollView = true,
- EdgeInsetsGeometry? margin,
- Widget? bottomSheet,
- Widget? drawer,
- DragStartBehavior drawerDragStartBehavior = DragStartBehavior.start,
- double? drawerEdgeDragWidth,
- bool drawerEnableOpenDragGesture = true,
- Color? drawerScrimColor,
- bool endDrawerEnableOpenDragGesture = true,
- DrawerCallback? onDrawerChanged,
- DrawerCallback? onEndDrawerChanged,
- bool extendBody = false,
- bool extendBodyBehindAppBar = false,
- bool primary = true,
- String? restorationId,
- Color? backgroundColor,
- bool isRootPage = false,
- WillPopCallback? onWillPop,
- VoidCallback? onRefresh,
- VoidCallback? onLoading,
- double? 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,
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));