CrudService<T> class
Base class to create CRUD services from
Usage:
class MyCrudService extends CrudBase {
MyCrudService(
TokenGetter tokenGetter,
String baseUrl, {
String? requestRole,
}) : super(tokenGetter, baseUrl, 'path', requestRole);
}
Constructors
- CrudService(TokenGetter tokenGetter, String baseUrl, String path, String? requestRole)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
create(
T item, {String? callRole}) → Future< T> - Create an entity Usage:
-
delete(
String id, {String? callRole}) → Future< T> - Delete an entity Usage:
-
edit(
String id, T item, {String? callRole}) → Future< T> - Update an entity Usage:
-
getAll(
{Map params = const {}, String? callRole}) → Future< T> - Get all entities Usage:
-
getOne(
String id, {String? callRole}) → Future< T> - Get a single Entity Usage:
-
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