CommandSync<TParam, TResult> class
- Inheritance
-
- Available extensions
Properties
-
asyncNotification
→ bool
-
If true, the listeners will be notified asynchronously, which can be helpful
if you encounter problems that you trigger rebuilds during the build phase.
finalinherited
-
canExecute
→ ValueListenable<bool>
-
ValueListenable<bool>
that changes its value on any change of the current
executability state of the command. Meaning if the command can be executed or not.
This will issue false
while the command executes, but also if the command
receives a false from the canExecute ValueListenable
that you can pass when
creating the Command.
its value is restriction.value && !isExecuting.value
no setterinherited
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
hasListeners
→ bool
-
Whether any listeners are currently registered.
no setterinherited
-
isExecuting
→ ValueListenable<bool>
-
ValueListenable
that changes its value on any change of the execution
state change of the command
no setteroverride
-
listenerCount
↔ int
-
getter/setter pairinherited
-
mode
→ CustomNotifierMode
-
finalinherited
-
results
→ ValueListenable<CommandResult<TParam?, TResult>>
-
emits
CommandResult<TResult>
the combined state of the command, which is
often easier in combination with Flutter's ValueListenableBuilder
because you have all state information at one place.
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
thrownExceptions
→ ValueListenable<CommandError?>
-
ValueListenable<CommandError>
that reflects the Error State of the command
it value is reset to null
at the beginning of every command execution
if the wrapped function throws an error, its value is set to the error is
wrapped in an CommandError
no setterinherited
-
value
↔ TResult
-
The current value of the object. When the value changes, the callbacks
registered with addListener will be invoked.
getter/setter pairinherited
Methods
-
addListener(void listener())
→ void
-
Register a closure to be called when the object changes.
inherited
-
call([TParam? param])
→ void
-
This makes Command a callable class, so instead of
myCommand.execute()
you can write myCommand()
inherited
-
dispose()
→ void
-
If you don't need a command any longer it is a good practise to
dispose it to make sure all registered notification handlers are remove to
prevent memory leaks
inherited
-
execute([TParam? param])
→ void
-
Calls the wrapped handler function with an optional input parameter
override
-
executeWithFuture([TParam? param])
→ Future<TResult>
-
Executes an async Command and returns a Future that completes as soon as
the Command completes. This is especially useful if you use a
RefreshIndicator
inherited
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners()
→ void
-
Call all the registered listeners.
inherited
-
removeListener(void listener())
→ void
-
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited
-
toWidget({required Widget onResult(TResult lastResult, TParam? param), Widget whileExecuting(TResult lastResult, TParam? param)?, Widget onError(Object? error, TParam? param)?})
→ Widget
-
Returns a the result of one of three builders depending on the current state
of the Command. This function won't trigger a rebuild if the command changes states
so it should be used together with get_it_mixin, provider, flutter_hooks and the like.
inherited