BaseAngelService<Id, Data> class
Queries a service over REST.
An error response, or one that cannot be read, is thrown as an
AngelHttpException, and also added to the stream of the method, unless
the service is closed. Data that cannot be encoded is thrown as an
ArgumentError, and a failure to send the request, such as a
ClientException, as it is; neither is added to the stream.
Constructors
-
BaseAngelService(BaseClient client, BaseAngelClient app, dynamic baseUrl, {AngelDeserializer<
Data> ? deserializer})
Properties
- app → BaseAngelClient
-
The Angel instance powering this service.
final
- baseUrl → Uri
-
final
- client → BaseClient
-
final
-
deserializer
→ AngelDeserializer<
Data> ? -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
onCreated
→ Stream<
Data> -
Fired on
createdevents.no setteroverride -
onIndexed
→ Stream<
List< Data> > -
Fired on
indexedevents.no setteroverride -
onModified
→ Stream<
Data> -
Fired on
modifiedevents.no setteroverride -
onRead
→ Stream<
Data> -
Fired on
readevents.no setteroverride -
onRemoved
→ Stream<
Data> -
Fired on
removedevents.no setteroverride -
onUpdated
→ Stream<
Data> -
Fired on
updatedevents.no setteroverride - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → Future -
override
-
create(
Data data, [Map< String, dynamic> ? params]) → Future<Data> -
Creates a resource.
override
-
deserialize(
dynamic x) → Data? -
index(
[Map< String, dynamic> ? params]) → Future<List< Data> > -
Retrieves all resources.
override
-
makeBody(
dynamic x) → String -
map<
U> (U encoder(Data), Data decoder(U)) → Service< Id, U> -
Creates a Service that wraps over this one, and maps input and output using two converter functions.
inherited
-
modify(
Id id, Data data, [Map< String, dynamic> ? params]) → Future<Data> -
Modifies a resource.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
Id id, [Map< String, dynamic> ? params]) → Future<Data> -
Retrieves the desired resource.
override
-
remove(
Id id, [Map< String, dynamic> ? params]) → Future<Data> -
Removes the given resource.
override
-
send(
BaseRequest request) → Future< StreamedResponse> -
toString(
) → String -
A string representation of this object.
inherited
-
update(
Id id, Data data, [Map< String, dynamic> ? params]) → Future<Data> -
Overwrites a resource.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited