FutureBuilder<T> class
Similar to Flutters FutureBuilder. Build something depending of the result of a future.
Example:
FutureBuilder<String>(
future: loadDataFromServer(),
builder: (AsyncSnapshot<String> snapshot, Widget parent) =>
divElement(text: snapshot.data ?? snapshot.error?.toString() ?? 'No data yet'),
).appendTo(this);
- Inheritance
-
- Object
- Widget
- StatefulWidget
- FutureBuilder
Constructors
-
FutureBuilder({required Future<
T> future, required Widget builder(BuildContext context, AsyncSnapshot<T> snapshot)}) -
const
Properties
-
builder
→ Widget Function(BuildContext context, AsyncSnapshot<
T> snapshot) -
final
-
future
→ Future<
T> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createState(
) → StateWidget< FutureBuilder< T> > -
override
-
inflate(
BuildContext context) → void -
Set this widget context, build it’s child, and render the widget, updating
Context.element
When overriding pay attention that inflate need to callbuild
and renderinherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
render(
BuildContext context) → Element -
Render the DOM element and add it to the context.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited