INNER CODE UNIT · Dart
BackgroundUseCaseMessage
ShadyBoukhary/flutter_clean_architecture · lib/src/background_usecase.dart:13
class BackgroundUseCaseMessage<T> {
T? data;
Error? error;
bool? done;
BackgroundUseCaseMessage({this.data, this.error, this.done = false});
}
/// Data structure sent from the main isolate to the other isolate
class BackgroundUseCaseParams<T> {
T? params;
SendPort port;
BackgroundUseCaseParams(this.port, {this.params});
}
/// A specialized type of [UseCase] that executes on a different isolate.
/// The purpose is identical to [UseCase], except that this runs on a different isolate.
/// A [BackgroundUseCase] is useful when performing expensive operations that ideally
/// should not be performed on the main isolate.