InjectedCRUDImp<T, P> class
An implementation of InjectedCRUD
- Inheritance
-
- Object
- ReactiveModel<
List< T> > - ReactiveModelImp<
List< T> > - InjectedImp<
List< T> > - InjectedImpRedoPersistState<
List< T> > - InjectedCRUDImp
- Mixed-in types
-
- InjectedCRUD<
T, P>
- InjectedCRUD<
- Available extensions
Constructors
-
InjectedCRUDImp({required ICRUD<
T, P> repoCreator(), required P param()?, required bool readOnInitialization, required OnCRUDSideEffects? onCRUDSideEffects, required StateInterceptor<List< ? stateInterceptor, required SideEffects<T> >List< ? sideEffects, required DependsOn<T> >List< ? dependsOn, required int undoStackLength, required PersistState<T> >List< persist()?, required bool autoDisposeWhenNotUsed, required String? debugPrintWhenNotifiedPreMessage, required String toDebugString(List<T> >T> ?)?}) - An implementation of InjectedCRUD
Properties
- autoDisposeWhenNotUsed → bool
-
finalinherited
-
cachedCreatorMocks
↔ List<
dynamic Function()?> -
getter/setter pairinherited
- canRedoState → bool
-
Whether the state can be redone.
no setterinherited
- canUndoState → bool
-
Whether the state can be done
no setterinherited
- completer ↔ Completer?
-
getter/setter pairinherited
- connectionState → ConnectionState
-
no setterinherited
- creator → Object? Function()
-
finalinherited
- creatorUpdatable ↔ Object? Function()
-
getter/setter pairinherited
-
crud
→ _CRUDService<
T, P> -
To create Read Update and Delete
no setterinherited
- customStatus ↔ Object?
-
Custom status of the state. Set manually to mark the state with a particular
tag to be used in your logic.
getter/setter pairinherited
- debugPrintWhenNotifiedPreMessageGlobal → String?
-
finalinherited
-
dependsOn
→ DependsOn<
List< ?T> > -
finalinherited
- error → dynamic
-
The error
no setterinherited
- hasData → bool
-
The state is mutated successfully.
no setterinherited
- hasError → bool
-
The stats has error
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasObservers → bool
-
Whether the state has listeners or not
no setterinherited
-
inheritedInjects
→ Set<
InjectedImp< List< >T> > -
finalinherited
-
initialSnapState
→ SnapState<
List< T> > -
no setterinherited
-
initialState
↔ List<
T> ? -
getter/setter pairinherited
- isDone → bool
-
The state is mutated using a stream and the stream is done.
no setterinherited
- isIdle → bool
-
The state is initialized and never mutated.
no setterinherited
- isInitialized ↔ bool
-
getter/setter pairinherited
- isOnCRUD → bool
-
Whether the state is waiting for a CRUD operation to finish
no setterinherited
- isStateInitialized → bool
-
no setterinherited
- isWaiting → bool
-
The state is waiting for and asynchronous task to end.
no setterinherited
- isWaitingToInitialize ↔ bool
-
getter/setter pairinherited
-
item
→ _Item<
T, P> -
Optimized for item displaying. Used with
latefinalinherited
- mockableCreator → Object? Function()
-
no setteroverride
- observerLength → int
-
no setterinherited
-
oldSnapState
→ SnapState<
List< ?T> > -
no setterinherited
-
onCrudRM
→ ReactiveModelImp<
Object?> -
no setter
- onCRUDSideEffects → OnCRUDSideEffects?
-
final
- param → P Function()?
-
final
- readOnInitialization → bool
-
final
- removeFromReactiveModel ↔ VoidCallback?
-
getter/setter pairinherited
-
repoCreator
→ ICRUD<
T, P> Function() -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
shouldRecreateTheValue
↔ List<
T> ? -
getter/setter pairinherited
-
sideEffectsGlobal
→ SideEffects<
List< ?T> > -
finalinherited
-
snapState
→ SnapState<
List< T> > -
A snap representation of the state
no setterinherited
-
snapValue
↔ SnapState<
List< T> > -
getter/setter pairinherited
-
state
↔ List<
T> -
The current state
getter/setter pairinherited
-
stateAsync
↔ Future<
List< T> > -
The current Async state
getter/setter pairinherited
-
stateInterceptorGlobal
→ StateInterceptor<
List< ?T> > -
finalinherited
- subscription ↔ StreamSubscription?
-
It is not null if the state is waiting for a Future or is subscribed to a
Stream
getter/setter pairinherited
-
toDebugString
→ Object? Function(List<
T> ?)? -
finalinherited
-
undoRedoPersistState
↔ UndoRedoPersistState<
List< ?T> > -
getter/setter pairinherited
-
watch
→ Object? Function(List<
T> ? s)? -
finalinherited
Methods
-
addCleaner(
VoidCallback listener) → VoidCallback -
Add a callback to be executed when the state is disposed of.
inherited
-
addObserver(
{required ObserveReactiveModel listener, bool shouldAutoClean = false, bool isSideEffects = true}) → VoidCallback -
Add observer to this state.
inherited
-
call(
BuildContext context, {bool defaultToGlobal = false}) → Injected< List< T> > -
Obtain the Injected model from the nearest InheritedWidget inserted using inherited.
inherited
-
cleanState(
) → void -
Clean the state
inherited
-
clearUndoStack(
) → void -
Clear undoStack;
inherited
-
deletePersistState(
) → void -
Delete the state form the persistence store
inherited
-
dispose(
) → void -
Dispose the state
override
-
disposeIfNotUsed(
) → void -
Dispose the state if it has no listener
inherited
-
getRepoAs<
R extends ICRUD< (T, P> >) → R -
Get the repository implementation
inherited
-
inherited(
{required Widget builder(BuildContext), Key? key, required FutureOr< List< stateOverride()?, bool? connectWithGlobal, SideEffects<T> >List< ? sideEffects, String? debugPrintWhenNotifiedPreMessage, Object? toDebugString(List<T> >T> ?)?}) → Widget -
Provide the injected model using an InheritedWidget that wraps its state.
inherited
-
initialize(
) → void -
inherited
-
initializeState(
) → FutureOr< List< T> ?> -
Initialize the state
inherited
-
injectCRUDMock(
ICRUD< T, P> fakeRepository()) → void -
Inject a fake implementation of this injected model.
inherited
-
injectFutureMock(
Future< List< fakeCreator()) → voidT> > -
Inject a fake future implementation of this injected model.
override
-
injectMock(
List< T> fakeCreator()) → void -
Inject a fake implementation of this injected model.
inherited
-
injectStreamMock(
Stream< List< fakeCreator()) → voidT> > -
Inject a fake stream implementation of this injected model.
inherited
-
interceptState(
SnapState< List< snap, StateInterceptor<T> >List< ? stateInterceptor) → SnapState<T> >List< ?T> > -
inherited
-
middleSetCreator(
StateStatus status, Object? result) → void -
inherited
-
middleSetState(
StateStatus status, Object? result, {SideEffects< List< ? sideEffects, StateInterceptor<T> >List< ? stateInterceptor, bool shouldOverrideDefaultSideEffects(SnapState<T> >List< )?}) → dynamicT> > -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notify(
{SnapState< List< ? nextSnap, SideEffects<T> >List< ? sideEffects, bool shouldOverrideDefaultSideEffects(SnapState<T> >List< )?, StateInterceptor<T> >List< ? stateInterceptor}) → boolT> > -
Notify observers
inherited
-
of(
BuildContext context, {bool defaultToGlobal = false}) → List< T> -
Obtain the state from the nearest InheritedWidget inserted using inherited.
inherited
-
onAll<
R> ({R onIdle()?, required R onWaiting()?, required R onError(dynamic error, VoidCallback refreshError)?, required R onData(List< T> data)}) → R -
Listen to the injected Model and rebuild when it emits a notification.
inherited
-
onMiddleCRUD(
SnapState snap) → void -
onOrElse<
R> ({R onIdle()?, R onWaiting()?, R onError(dynamic error, VoidCallback refreshError)?, R onData(List< T> data)?, required R orElse(List<T> data)}) → R -
Listen to the injected Model and rebuild when it emits a notification.
inherited
-
onStateInitialized(
) → void -
inherited
-
persistState(
) → void -
Persist the state
inherited
-
rebuildState(
) → void -
inherited
-
redoState(
) → void -
Redo to the next valid state (isWaiting and hasError are ignored)
inherited
-
refresh(
{String? infoMessage}) → Future< List< T> ?> -
Refresh the Injected state. Refreshing the state means reinitialize
it and reinvoke its creation function and notify its listeners.
inherited
-
reInherited(
{Key? key, required BuildContext context, required Widget builder(BuildContext context)}) → Widget -
Provide the Injected model to another widget tree branch.
inherited
-
resetDefaultState(
[VoidCallback? fn]) → void -
override
-
setState(
Object? mutator(List< T> s), {SideEffects<List< ? sideEffects, StateInterceptor<T> >List< ? stateInterceptor, bool shouldOverrideDefaultSideEffects(SnapState<T> >List< snap)?, int debounceDelay = 0, int throttleDelay = 0}) → Future<T> >List< T> ?> -
Mutate the state of the model and notify observers.
inherited
-
setStateNullable(
Object? mutator(List< T> ? s), {required void middleSetState(StateStatus, dynamic result), required StackTrace? stackTrace}) → FutureOr<List< T> ?> -
inherited
-
setToHasData(
dynamic data, {SideEffects< List< ? sideEffects, bool shouldOverrideDefaultSideEffects(SnapState<T> >List< )?, StateInterceptor<T> >List< ? stateInterceptor}) → voidT> > -
Set the state to the data status
inherited
-
setToHasError(
dynamic error, {StackTrace? stackTrace, VoidCallback? refresher, SideEffects< List< ? sideEffects, bool shouldOverrideDefaultSideEffects(SnapState<T> >List< )?, StateInterceptor<T> >List< ? stateInterceptor}) → voidT> > -
Set the state to the error status
inherited
-
setToIsIdle(
[Object? data]) → void -
Set the state to the idle status
inherited
-
setToIsWaiting(
{SideEffects< List< ? sideEffects, bool shouldOverrideDefaultSideEffects(SnapState<T> >List< )?, StateInterceptor<T> >List< ? stateInterceptor}) → voidT> > -
Set the state to the waiting status
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
undoState(
) → void -
Undo to the last valid state (isWaiting and hasError are ignored)
inherited
-
whenConnectionState<
R> ({R onIdle()?, required R onWaiting()?, required R onError(dynamic error)?, required R onData(List< T> data)}) → R -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited