CrudService<T extends BaseObject> class
Refactored CrudService with support for multiple channels and method-level strategy.
- Implemented types
-
- ICrudService<
T>
- ICrudService<
Constructors
-
CrudService({required IDatabasePlatform<
T> databasePlatform, int sortFunc(T a, T b)?})
Properties
-
crud
→ IDatabasePlatform<
T> -
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sortFunc → int Function(T a, T b)?
-
final
Methods
-
createItem(
T item, {Future< Result< alternativeFunc(T)?, String channel = 'main'}) → Future<int, String, T?> >Result< int, String, T?> > -
override
-
deleteItem(
String id, {Future< Result< alternativeFunc(String)?, String channel = 'main'}) → Future<int, String, T?> >Result< int, String, T?> > -
override
-
getItem(
{String? id, Future< Result< alternativeFunc()?, dynamic docRef, String channel = 'main', CrudStrategy strategy = const DefaultCrudStrategy()}) → Future<int, String, T?> >Result< int, String, T?> > -
override
-
getItems(
{bool getCount = false, Future< Result< alternativeFunc()?, List<int, String, List< >T> >DataFilter> ? subCollectionQuery, bool? useCursor, int limit = 1000, String channel = 'main', CrudStrategy strategy = const DefaultCrudStrategy()}) → Future<Result< int, String, List< >T> > -
override
-
getWholeCollection(
{List< DataFilter> ? subCollectionQuery, int limit = 1000, String channel = 'main', CrudStrategy strategy = const DefaultCrudStrategy()}) → Future<Result< int, String, List< >T> > -
override
-
itemsStream(
{String channel = 'main'}) → ValueStream< List< T> > -
override
-
itemStream(
{String channel = 'main'}) → ValueStream< T?> -
override
-
itemWhere(
{required List< DataFilter> query, required T? choiceFunction(List<T> ), String channel = 'main', CrudStrategy strategy = const DefaultCrudStrategy()}) → Future<Result< int, String, T?> > -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resultStream(
{String channel = 'main'}) → ValueStream< Result< int, String, T?> > -
override
-
setItem(
T item, {Future< Result< alternativeFunc(T item)?, String channel = 'main', CrudStrategy strategy = const DefaultCrudStrategy()}) → Future<int, String, T?> >Result< int, String, T?> > -
override
-
toString(
) → String -
A string representation of this object.
inherited
-
updateCacheRelations(
{Set< String> ? oldRels, Set<String> ? newRels, required String fieldToUpdate, required ItemCreator<T> creator, String channel = 'main', CrudStrategy strategy = const DefaultCrudStrategy()}) → Future<Result< int, String, List< >T> ?> -
override
-
updateFields(
String id, Map< String, dynamic> map) → Future<Result< int, String, T?> > -
override
-
updateItem(
T item, {Future< Result< alternativeFunc(T item)?, String channel = 'main', CrudStrategy strategy = const DefaultCrudStrategy()}) → Future<int, String, T?> >Result< int, String, T?> > -
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited