ProgressDialogResult<T> class sealed

This class is used to wrap the result of asynchronous operations shown in progress dialogs. It can either be a Success containing the operation's result value, or a Failure containing error details if the operation failed.

The type parameter T represents the type of value that will be returned in case of success.

Example usage:

ProgressDialogResult<String> result = await showProgressDialog(...);
switch (result) {
  case Success<String>(value: var value):
    print('Success: $value');
  case Failure<String>(error: var error, stackTrace: var trace):
    print('Error: $error');
}
Implementers

Properties

hashCode int
The hash code for this object.
no setterinherited
isError bool
Returns true if this result represents an error/failure case, false otherwise. This is equivalent to checking if the result is an instance of Failure.
no setter
isSuccess bool
Returns true if this result represents a successful operation, false otherwise. This is equivalent to checking if the result is an instance of Success.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

flatMap<R>(ProgressDialogResult<R> fn(T value)) ProgressDialogResult<R>
Chains results by applying the provided function to success values
map<R>(R fn(T value)) ProgressDialogResult<R>
Maps the success value to a new value using the provided function
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
unwrap() → T
Unwraps the result, returning the success value or throwing the error

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

failure<T>(Object error, [StackTrace? stackTrace]) ProgressDialogResult<T>
Creates a failure result with the given error and optional stack trace
success<T>(T value) ProgressDialogResult<T>
Creates a success result with the given value