JsonDynamicBuilder class

Builder that builds children based on the state the listened value. Listened value name is equal to id field value. Children are created from childTemplate with usage of ${dynamic} function. childTemplate is able to use template values via {} format. For example to use an id value in a template just putting there {id} is enough. Templating mechanism uses Interpolation underneath.

See the fromDynamic for the format.

Inheritance

Constructors

JsonDynamicBuilder({required dynamic args, required String childTemplate, required String builderType, required Iterable<Map<String, dynamic>> initState, JsonWidgetRegistry? registry})
const

Properties

args → dynamic
finalinherited
builderType String
final
childTemplate String
final
hashCode int
The hash code for this object.
no setterinherited
initState Iterable<Map<String, dynamic>>
final
preferredSizeWidget bool
finalinherited
registry JsonWidgetRegistry?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
Returns the type of widget this widget contains.
no setteroverride

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
createModel({ChildWidgetBuilder? childBuilder, required JsonWidgetData data}) JsonWidgetBuilderModel
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
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}) JsonDynamicBuilder
Builds the builder from a Map-like dynamic structure. This expects the JSON format to be of the following structure:
maybeFromDynamic(dynamic map, {JsonWidgetRegistry? registry}) JsonDynamicBuilder?
Builds the builder from a Map-like dynamic structure. This expects the JSON format to be of the following structure:

Constants

kType → const String