Futuristic<T> class
A widget that makes it easy to execute a Future from a StatelessWidget.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- Futuristic
Constructors
-
Futuristic.new({Key? key, required AsyncValueGetter<
T> futureBuilder, bool autoStart = false, Widget initialBuilder(BuildContext, VoidCallback )?, WidgetBuilder? busyBuilder, Widget errorBuilder(BuildContext, Object, VoidCallback )?, Widget dataBuilder(BuildContext, T?)?, ValueChanged<T> ? onData, dynamic onError(Object, VoidCallback )?}) -
const
Properties
- autoStart → bool
-
Whether to immediately begin executing the Future. If true, initialBuilder must be null.
final
- busyBuilder → WidgetBuilder?
-
Widget to display while the Future is executing.
If null, a CircularProgressIndicator will be displayed.
final
- dataBuilder → Widget Function(BuildContext, T?)?
-
Widget to display when the Future has completed successfully.
If null, initialBuilder will be displayed again.
final
- errorBuilder → Widget Function(BuildContext, Object, VoidCallback )?
-
Widget to display when the Future has completed with an error.
If null, initialBuilder will be displayed again.
The Object is the Error or Exception returned by the Future.
Call VoidCallback to start executing the Future again.
final
-
futureBuilder
→ AsyncValueGetter<
T> -
Function that returns the Future to execute. Not the Future itself.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialBuilder → Widget Function(BuildContext, VoidCallback )?
-
Widget to display before the Future starts executing.
Call VoidCallback to start executing the Future.
If not null, autoStart should be false.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onData
→ ValueChanged<
T> ? -
Callback to invoke when the Future has completed successfully.
Will only be invoked once per Future execution.
final
- onError → dynamic Function(Object, VoidCallback )?
-
Callback to invoke when the Future has completed with an error.
Will only be invoked once per Future execution.
Call VoidCallback to start executing the Future again.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< Futuristic< T> > -
Creates the mutable state for this widget at a given location in the tree.
override
-
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