ServiceBase<T> class
abstract
Base class to create services from, dont extend from this if not necesary, prefer creating a Service instance
Usage:
class MyClass extends ServiceBase<Entity> {
// stuff
}
- Implemented types
- Implementers
Constructors
- ServiceBase(String baseUrl, String path, {String requestRole = CrudRequestRoles.USER})
Properties
- baseUrl ↔ String
-
The root url of the service, usually the url of the API
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- path ↔ String
-
The main path of the service.
getter/setter pair
- requestRole ↔ String
-
Specifies for what CrudRequestRoles is this request
Defaults to CrudRequestRoles.USER
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
delete(
String path) → Future - Make a DELETE request to a specific path
-
get(
String path) → Future< T> - Make a GET request to a specific path
-
getToken(
) → Future< String?> -
Abstract method for getting the token (if needed)
override
-
mapper(
dynamic data) → T - Abstract method for mapping this service's data
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
post(
String path, dynamic item) → Future< T> - Make a POST request to a specific path with some data
-
put(
String path, dynamic item) → Future< T> - Make a PUT request to a specific path with some data
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited