DataSource class abstract
Interface for LocalWidgetBuilder to obtain data from arguments.
The interface exposes the v method, the argument to which is a list of keys forming a path to a node in the arguments expected by the widget. If the method's type argument does not match the value obtained, null is returned instead.
In addition, to fetch widgets specifically, the child and childList methods must be used, and to fetch event handlers, the handler method must be used.
The isList and isMap methods can be used to avoid inspecting keys that may not be present (e.g. before reading 15 keys in a map that isn't even present, consider checking if the map is present using isMap and short-circuiting the key lookups if it is not).
To iterate over a list, the length method can be used to find the number of items in the list.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
builder(
List< Object> argsKey, DynamicMap builderArg) → Widget - Builds the widget builder at the given key.
-
child(
List< Object> argsKey) → Widget - Build the child at the given key.
-
childList(
List< Object> argsKey) → List<Widget> - Builds the children at the given key.
-
handler<
T extends Function> (List< Object> argsKey, HandlerGenerator<T> generator) → T? - Gets an event handler at the given key.
-
isList(
List< Object> argsKey) → bool - Return true if the given key identifies a list, otherwise false.
-
isMap(
List< Object> argsKey) → bool - Return true if the given key identifies a map, otherwise false.
-
length(
List< Object> argsKey) → int - Return the length of the list at the given path of the arguments to the widget.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
optionalBuilder(
List< Object> argsKey, DynamicMap builderArg) → Widget? - Builds the widget builder at the given key.
-
optionalChild(
List< Object> argsKey) → Widget? - Build the child at the given key.
-
toString(
) → String -
A string representation of this object.
inherited
-
v<
T extends Object> (List< Object> argsKey) → T? - Return the int, double, bool, or String value at the given path of the arguments to the widget.
-
voidHandler(
List< Object> argsKey, [DynamicMap? extraArguments]) → VoidCallback? - Gets a VoidCallback event handler at the given key.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited