Remote class
backend Singleton to provide all functionality related to the backend
Constructors
- Remote.new()
-
factory
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
-
connectionGuard(
{Duration? timeout}) → Future - checks whether a connection to the backend is possible throws NoConnectionToBackendException or SocketException if its not.
-
delete<
DataT extends Data> (DataT? data) → RequestAndParser< Response, String?> -
deletes a
DataT
and returns the response -
deleteImageByHash(
String hash) → RequestAndParser< BaseResponse, String?> - deletes an image specified by its hash and returns the response
-
getDocument(
String docPath) → RequestAndParser< BaseResponse, File?> -
getImageByHash(
String hash, {bool compressed = false}) → RequestAndParser< BaseResponse, ImageData< Object> ?> -
getNextDatapoint<
ChildData extends Data, ParentData extends WithOffline?> (ParentData data, {dynamic preloadFullImages = false}) → RequestAndParser< Response, List< ChildData> > -
gets all the
ChildData
points for the givenParentData
if noParentData
is given it defaults to root -
injectUser(
User? user) → dynamic -
login(
User user) → Future< User?> - login a User by checking if he exists in the remote database
-
makepost(
String route, {Map< String, String> ? headers, String? body, Encoding? encoding}) → Request - make an actual API request to a route, and always append the API_KEY as authorization-header
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
post(
String route, {Map< String, String> ? headers, String? body, Encoding? encoding, Duration? timeout}) → Future<Response?> - make an actual API request to a route, and always append the API_KEY as authorization-header
-
postJSON(
RequestData rd) → Future< BaseResponse?> - post_JSON to our backend as the user
-
postJSONWithSocketRetry(
RequestData rd, {int maxRetries = 3, Duration initialDelay = const Duration(seconds: 2), bool exponentialBackoff = true}) → Future< BaseResponse?> - Erweiterte Version von postJSON mit robuster Behandlung von Socket-Fehlern Besonders wichtig für Hintergrundprozesse, bei denen die App in den Hintergrund wechselt
-
send(
Request request, {Duration? timeout, bool returnsBinary = false}) → Future< Response?> -
setMainImageByHash<
DataT extends Data> (DataT? data, String mainhash) → RequestAndParser< Response, String?> -
setNew<
DataT extends Data> (DataT? data) → RequestAndParser< Response, DataT?> -
sets a new
DataT
-
toString(
) → String -
A string representation of this object.
inherited
-
update<
DataT extends Data> (DataT? data) → RequestAndParser< Response, String?> -
updates a
DataT
and returns the response -
uploadNewImagesOrFiles<
DataT extends Data> (DataT data, List< XFile> files) → RequestAndParser<BaseResponse, String?> - upload a bunch of images
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited