JsonScaffoldBuilder class
Builder that can build an Scaffold widget. See the fromDynamic for the format.
- Inheritance
-
- Object
- JsonWidgetBuilder
- JsonScaffoldBuilder
Constructors
-
JsonScaffoldBuilder.new({JsonWidgetData? appBar, Color? backgroundColor, JsonWidgetData? body, JsonWidgetData? bottomSheet, JsonWidgetData? drawer, required DragStartBehavior drawerDragStartBehavior, double? drawerEdgeDragWidth, required bool drawerEnableOpenDragGesture, Color? drawerScrimColor, JsonWidgetData? endDrawer, required bool endDrawerEnableOpenDragGesture, required bool extendBody, required bool extendBodyBehindAppBar, JsonWidgetData? floatingActionButton, FloatingActionButtonAnimator? floatingActionButtonAnimator, FloatingActionButtonLocation? floatingActionButtonLocation, ValueChanged<
bool> ? onDrawerChanged, ValueChanged<bool> ? onEndDrawerChanged, required bool primary, bool? resizeToAvoidBottomInset, String? restorationId}) -
const
Properties
- appBar → JsonWidgetData?
-
final
- backgroundColor → Color?
-
final
- body → JsonWidgetData?
-
final
-
final
- bottomSheet → JsonWidgetData?
-
final
- drawer → JsonWidgetData?
-
final
- drawerDragStartBehavior → DragStartBehavior
-
final
- drawerEdgeDragWidth → double?
-
final
- drawerEnableOpenDragGesture → bool
-
final
- drawerScrimColor → Color?
-
final
- endDrawer → JsonWidgetData?
-
final
- endDrawerEnableOpenDragGesture → bool
-
final
- extendBody → bool
-
final
- extendBodyBehindAppBar → bool
-
final
- floatingActionButton → JsonWidgetData?
-
final
- floatingActionButtonAnimator → FloatingActionButtonAnimator?
-
final
- floatingActionButtonLocation → FloatingActionButtonLocation?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- numSupportedChildren → int
-
finalinherited
-
onDrawerChanged
→ ValueChanged<
bool> ? -
final
-
onEndDrawerChanged
→ ValueChanged<
bool> ? -
final
-
final
-
final
- preferredSizeWidget → bool
-
finalinherited
- primary → bool
-
final
- resizeToAvoidBottomInset → bool?
-
final
- restorationId → String?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
build(
{required ChildWidgetBuilder? childBuilder, required BuildContext context, required JsonWidgetData data}) → Widget -
Builds the widget. If there are dynamic keys on the
data
object, and the widget is not a PreferredSizeWidget, then the returned widget will be wrapped by a stateful widget that will rebuild if any of the dynamic args change in value.inherited -
buildCustom(
{ChildWidgetBuilder? childBuilder, required BuildContext context, required JsonWidgetData data, Key? key}) → Widget -
Custom builder that subclasses must override and implement to return the
actual Widget to be placed on the tree.
override
-
getChild(
JsonWidgetData? data, {int index = 0}) → JsonWidgetData -
Returns a non-null child for widgets that must always have child widgets.
This allows the widget to be built and rendered even if the child is
missing.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
JsonWidgetData data) → void -
Called when a JSON widget is removed from the tree due to a conditional.
Custom widgets may need to implement this to clean up values that may have
been placed on the JsonWidgetRegistry by the widget.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromDynamic(
dynamic map, {JsonWidgetRegistry? registry}) → JsonScaffoldBuilder? -
Builds the builder from a Map-like dynamic structure. The scaffold is a
special case that uses
child
as an alias for thebody
attribute. This preserves the tree-like structure of the dynamic widgets internally but allows developers to use the more common terms. This expects the JSON format to be of the following structure:
Constants
- kNumSupportedChildren → const int
- type → const String