FakeSearchUseCase<T extends BlocxBaseEntity> class
Fake search use case.
- Inheritance
-
- Object
- BlocxBaseUseCase<
BlocxSearchInput, BlocxPage< T> > - BlocxPaginatedUseCase<
BlocxSearchInput, T> - BlocxSearchUseCase<
BlocxSearchInput, T> - FakeSearchUseCase
Constructors
-
FakeSearchUseCase({FakePaginatedSource<
T> ? source, bool matcher(T item, String query)?, bool shouldFail = false, Object? failureError, Completer<void> ? completer, BlocxEventHub? eventHub})
Properties
- commandType → BlocxCommandType?
-
Optional single CRUD command type executed by this use case.
no setterinherited
-
commandTypes
→ List<
BlocxCommandType> -
List of CRUD command types executed by this use case.
no setterinherited
-
completer
↔ Completer<
void> ? -
getter/setter pair
- eventHub → BlocxEventHub?
-
The BlocxEventHub used to broadcast entity command events when
commandType or commandTypes is configured.
no setterinherited
- eventOrigin → BlocxEventOrigin?
-
Optional origin metadata attached to emitted BlocxEntityEvents.
no setterinherited
- failureError ↔ Object?
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- matcher → bool Function(T item, String query)?
-
final
-
recordedInputs
→ List<
BlocxSearchInput> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shouldFail ↔ bool
-
getter/setter pair
-
source
→ FakePaginatedSource<
T> -
final
Methods
-
execute(
BlocxSearchInput input) → Future< BlocxUseCaseResult< BlocxPage< >T> > -
Entry point for callers. Do not override.
inherited
-
failureResult(
Object error, StackTrace stackTrace) → FutureOr< BlocxUseCaseResult< BlocxPage< >T> > -
Wraps an unhandled exception into a BlocxUseCaseResult.
inherited
-
handleBroadcastError(
Object error, StackTrace stackTrace) → void -
Optional side-effect hook for logging or reporting errors that occur during
entity resolution or event broadcasting after a successful perform.
inherited
-
handleError(
Object error, StackTrace stackTrace) → void -
Optional side-effect hook for logging, analytics, or crash reporting.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
perform(
BlocxSearchInput input) → Future< BlocxUseCaseResult< BlocxPage< >T> > -
The business logic implementation.
override
-
resolveCommandEntities(
BlocxSearchInput input, BlocxPage< T> output) → List<BlocxBaseEntity> -
Resolves the affected BlocxBaseEntity instances from
inputandoutputto broadcast to eventHub.inherited -
shouldBroadcastCommandResult(
BlocxSearchInput input, BlocxPage< T> output) → bool -
Whether a successful
outputshould trigger command event broadcasting.inherited -
success(
BlocxPage< T> data) → BlocxUseCaseResult<BlocxPage< T> > -
Shorthand for
BlocxUseCaseSuccess(data).inherited -
successResult(
{required List< T> items, required BlocxPaginatedInput input}) → BlocxUseCaseResult<BlocxPage< T> > -
Builds a successful paginated result from
itemsand the originatinginput.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited