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
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- MasterScaffoldWidget
Constructors
-
MasterScaffoldWidget({Key? key, required GlobalKey<
ScaffoldMessengerState> scaffoldMessengerKey, PreferredSizeWidget? appBar, required Widget body, bool? extendBody, bool? extendBodyBehindAppBar, bool? useSafeArea, Color? backgroundColor, PaddingVisibility? horizontalPadding, PaddingVisibility? verticalPadding, AppBarPaddingVisibility? appBarPadding, 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
-
final
- customAppBarPadding β double?
-
final
-
final
- customHorizontalPadding β double?
-
final
-
final
- customVerticalPadding β double?
-
final
- defaultAppBarPadding β double
-
final
-
final
- defaultHorizontalPadding β double
-
final
-
final
- defaultVerticalPadding β double
-
final
- extendBody β bool?
-
final
- extendBodyBehindAppBar β bool?
-
final
-
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