AsyncEditBuilder<T> class

A widget that allow to fetch a value asynchronously, and then to run another task asynchronously (to submit new value for instance) while updating UI with new value. Handle all states (loading, errors, onSuccess). It's actually a mix of FetchBuilder and SubmitBuilder combined. Typically used for component that needs to fetch a value and then edit that value. DON'T use this if fetch and submit tasks are not related (prefer using separate FetchBuilder and SubmitBuilder). Example : an async switch, that fetch the current value, and then can submit the new value.

Inheritance

Constructors

AsyncEditBuilder({Key? key, FetcherConfig? config, WidgetBuilder? fetchingBuilder, required AsyncValueGetter<T> fetchTask, required AsyncValueSetter<T> submitTask, required DataEditWidgetBuilder<T> builder, ValueSetter<T>? onEditSuccess})
const

Properties

builder DataEditWidgetBuilder<T>
Child widget builder
final
config FetcherConfig?
Widget configuration, that will override the one provided by DefaultFetcherConfig Config is applied to both FetchBuilder and SubmitBuilder
final
fetchingBuilder WidgetBuilder?
Widget to display while fetching Default to config.fetchingBuilder If you want to change the submit widget, you should use config.fetchingBuilder instead.
final
fetchTask AsyncValueGetter<T>
Task that fetch value If task throws, it will be properly handled
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onEditSuccess ValueSetter<T>?
Called after submitTask is successfully executed. Ignored if widget is unmounted.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
submitTask AsyncValueSetter<T>
Task that submit modification If task throws, it will be properly handled
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<AsyncEditBuilder<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