Success<T> class final

Class representing a successful result.

Inheritance
Annotations

Constructors

Success(T value)
Creates a Success with the given value.
const

Properties

errorOrNull → Object?
Returns the exception if Result is Failure or null otherwise.
no setterinherited
getOrNull → T?
Returns the value if Result is Success or null otherwise.
no setterinherited
hashCode → int
The hash code for this object.
no setteroverride
isFailure → bool
Returns true if Result is Failure.
no setterinherited
isSuccess → bool
Returns true if Result is Success.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → T
The value of the Result.
final

Methods

map<R>(R transform(T value)) → Result<R>
Maps the value of Result if it is Success or returns the same Result otherwise.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult success(T response), required TResult error(Object? error)}) → TResult
Maps the value of the result and returns the error or success TResult
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override