CompletableUseCase<Params> class abstract

A UseCase that doesn't return a value.

Use this for operations like delete, logout, or fire-and-forget actions.

Example

class LogoutUseCase extends CompletableUseCase<NoParams> {
  final AuthRepository _repository;

  LogoutUseCase(this._repository);

  @override
  Future<void> execute(NoParams params, CancelToken? cancelToken) async {
    await _repository.logout();
  }
}

// Usage
final result = await logoutUseCase(const NoParams());
result.fold(
  (_) => print('Logged out successfully'),
  (failure) => print('Logout failed: ${failure.message}'),
);
Inheritance

Constructors

CompletableUseCase()

Properties

hashCode int
The hash code for this object.
no setterinherited
logger → Logger
Logger instance for this class.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(Params params, {CancelToken? cancelToken}) Future<Result<void, AppFailure>>
Execute the use case with the given params.
inherited
execute(Params params, CancelToken? cancelToken) Future<void>
Override this method to implement the use case logic.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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