GetCommandP1<P1> class

Command with one generic parameter.

Inheritance

Constructors

GetCommandP1({bool enabled = true, bool executing = false})
Creates an instance.

Properties

canBeExecuted bool
Can the user execute the commandFunc.
no setterinherited
canUpdate bool
no setterinherited
commandFunc VoidFuncWith1Parameter<P1>?
The developer provided function that should be executed.
getter/setter pair
enabled bool
Is the command enabled.
no setterinherited
errorMessage String
An error message
no setterinherited
errorMessageProviderFunc ErrorMessageProvider?
A optional developer provided callback function that translates an exception to an error message.
getter/setter pairinherited
executing bool
Is the commandFunc currently executed.
no setterinherited
firstRebuild bool
getter/setter pairinherited
hasErrorMessage bool
Does the last call to of the commandFunc results to an errorMessage.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sentToStream bool
getter/setter pairinherited
state CommandState
The current state of the command.
no setterinherited
stream Stream<CommandState>
no setterinherited
string String
Same as toString() but using a getter.
no setterinherited
subject ↔ GetStream<CommandState>
getter/setter pairinherited
value CommandState
Returns the current value
getter/setter pairinherited

Methods

addError(Object error, [StackTrace? stackTrace]) → void
inherited
addListener(GetStream<CommandState> rxGetx) → void
This is an internal method. Subscribe to changes on the inner stream.
inherited
bindStream(Stream<CommandState> stream) → void
Binds an existing Stream<T> to this Rx
inherited
call([CommandState? v]) CommandState
updates the value to null and adds it to the Stream. Even with null-safety coming, is still an important feature to support, as call() doesn't accept null values. For instance, InputDecoration.errorText has to be null to not show the "error state".
inherited
close() → void
Closes the subscriptions for this Rx, releasing the resources.
inherited
dispose() → void
Releases all resources.
exec(P1 p1) FutureOr<void>
Executes the command function commandFunc.
listen(void onData(CommandState), {Function? onError, void onDone()?, bool? cancelOnError}) StreamSubscription<CommandState>
inherited
listenAndPump(void onData(CommandState event), {Function? onError, void onDone()?, bool? cancelOnError}) StreamSubscription<CommandState>
Returns a StreamSubscription similar to listen, but with the added benefit that it primes the stream with the current value, rather than waiting for the next value. This should not be called in onInit or anywhere else during the build process.
inherited
map<R>(R mapper(CommandState? data)) Stream<R>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refresh() → void
Makes a direct update of value adding it to the Stream useful when you make use of Rx for custom Types to referesh your UI.
inherited
resetState() → void
Resets the state to enabled, not executing without an errorMessage.
inherited
setState({bool? enabled, bool? executing, String? errorMessage}) → void
Sets the current state of the command.
inherited
toJson() → dynamic
Returns the json representation of value.
inherited
toString() String
A string representation of this object.
inherited
trigger(CommandState v) → void
Following certain practices on Rx data, we might want to react to certain listeners when a value has been provided, even if the value is the same. At the moment, we ignore part of the process if we .call(value) with the same value since it holds the value and there's no real need triggering the entire process for the same value inside, but there are other situations where we might be interested in triggering this.
inherited
update(void fn(CommandState? val)) → void
Uses a callback to update value internally, similar to refresh, but provides the current value as the argument. Makes sense for custom Rx types (like Models).
inherited

Operators

operator ==(Object o) bool
This equality override works for _RxImpl instances and the internal values.
inherited