MasterScaffoldWidget class

πŸ—οΈ Flexible scaffold widget that adapts based on parameters

This widget provides a common layout structure for MasterView classes with full customization capabilities. All parameters are optional and maintain backward compatibility with original hardcoded behavior.

πŸš€ Basic Usage

MasterScaffoldWidget(
  scaffoldMessengerKey: GlobalKey<ScaffoldMessengerState>(),
  appBar: AppBar(title: Text('My App')),
  body: MyContent(),
)

🎨 Custom Layout Example

MasterScaffoldWidget(
  scaffoldMessengerKey: key,
  appBar: appBar,
  body: content,
  useSafeArea: false,                    // πŸ”§ Disable SafeArea
  extendBody: false,                     // πŸ”§ Disable body extension
  navbarSpacer: const SpacerVisibility.enabled(type: CoreSpacerType.content),
  footerSpacer: const SpacerVisibility.disabled(),  // 🚫 No footer spacer
  horizontalPadding: const PaddingVisibility.enabled(value: 24.0), // πŸ“ Custom padding
)

🎯 Minimal Layout Example

MasterScaffoldWidget(
  scaffoldMessengerKey: key,
  body: content,
  navbarSpacer: const SpacerVisibility.disabled(),   // 🚫 No spacers
  footerSpacer: const SpacerVisibility.disabled(),   // 🚫 No spacers
  horizontalPadding: const PaddingVisibility.disabled(), // 🚫 No padding
)

πŸ“± App Bar Padding Example (SafeArea disabled)

MasterScaffoldWidget(
  scaffoldMessengerKey: key,
  appBar: MyAppBar(),
  body: content,
  useSafeArea: false,                               // πŸ”§ Disable SafeArea
  appBarPadding: const AppBarPaddingVisibility.enabled(value: 24.0), // πŸ“ Custom app bar padding
)

🚫 Disable App Bar Padding Example

MasterScaffoldWidget(
  scaffoldMessengerKey: key,
  appBar: MyAppBar(),
  body: content,
  useSafeArea: false,                               // πŸ”§ Disable SafeArea
  appBarPadding: const AppBarPaddingVisibility.disabled(), // 🚫 No app bar padding
)

🎨 Background Color Example

MasterScaffoldWidget(
  scaffoldMessengerKey: key,
  body: content,
  backgroundColor: Colors.blue,         // 🎨 Custom background color
)
Inheritance

Constructors

MasterScaffoldWidget({Key? key, required GlobalKey<ScaffoldMessengerState> scaffoldMessengerKey, PreferredSizeWidget? appBar, required Widget body, Widget? bottomNavigationBar, bool? extendBody, bool? extendBodyBehindAppBar, bool? useSafeArea, Color? backgroundColor, SpacerVisibility? navbarSpacer, SpacerVisibility? footerSpacer, PaddingVisibility? horizontalPadding, PaddingVisibility? verticalPadding, AppBarPaddingVisibility? appBarPadding, CoreSpacerType? customNavbarSpacerType, CoreSpacerType? customFooterSpacerType, CoreSpacerType defaultNavbarSpacerType = CoreSpacerType.navbar, CoreSpacerType defaultFooterSpacerType = CoreSpacerType.footer, double? customHorizontalPadding, double defaultHorizontalPadding = GridHelper.defaultMargin, double? customVerticalPadding, double defaultVerticalPadding = 16.0, double? customAppBarPadding, double defaultAppBarPadding = 16.0})
const

Properties

appBar β†’ PreferredSizeWidget?
final
appBarPadding β†’ AppBarPaddingVisibility?
final
backgroundColor β†’ Color?
final
body β†’ Widget
final
bottomNavigationBar β†’ Widget?
final
customAppBarPadding β†’ double?
final
customFooterSpacerType β†’ CoreSpacerType?
final
customHorizontalPadding β†’ double?
final
customNavbarSpacerType β†’ CoreSpacerType?
final
customVerticalPadding β†’ double?
final
defaultAppBarPadding β†’ double
final
defaultFooterSpacerType β†’ CoreSpacerType
final
defaultHorizontalPadding β†’ double
final
defaultNavbarSpacerType β†’ CoreSpacerType
final
defaultVerticalPadding β†’ double
final
extendBody β†’ bool?
final
extendBodyBehindAppBar β†’ bool?
final
footerSpacer β†’ SpacerVisibility?
final
hashCode β†’ int
The hash code for this object.
no setterinherited
horizontalPadding β†’ PaddingVisibility?
final
key β†’ Key?
Controls how one widget replaces another widget in the tree.
finalinherited
final
runtimeType β†’ Type
A representation of the runtime type of the object.
no setterinherited
scaffoldMessengerKey β†’ GlobalKey<ScaffoldMessengerState>
final
useSafeArea β†’ bool?
final
verticalPadding β†’ PaddingVisibility?
final

Methods

build(BuildContext context) β†’ Widget
Describes the part of the user interface represented by this widget.
override
createElement() β†’ StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() β†’ List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) β†’ void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) β†’ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) β†’ DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) β†’ String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) β†’ String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) β†’ String
Returns a one-line detailed description of the object.
inherited
toStringShort() β†’ String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) β†’ bool
The equality operator.
inherited