SodiumRemoteAdapter<T extends DataModel<T>> mixin

A special RemoteAdapter that adds an End-To-End-Encryption layer to all your requests.

The adapter will use the keyManager and sodium to encrypt all outgoing request data and to decrypt all incoming request data. The Aead algorithm of Sodium is used to archive this. Unique keys are transparently generate from a master key and rotated every 30 days to ensure a maximum security.

Superclass constraints
  • RemoteAdapter<T>

Properties

adapters Map<String, RemoteAdapter<DataModelMixin>>
All adapters for the relationship subgraph of T and their relationships.
no setterinherited
baseUrl String
Returns the base URL for this type T.
no setterinherited
defaultHeaders FutureOr<Map<String, String>>
A Map representing default HTTP headers.
no setterinherited
defaultParams FutureOr<Map<String, dynamic>>
A Map representing default HTTP query parameters. Defaults to empty.
no setterinherited
graph → GraphNotifier
A GraphNotifier instance also available to adapters
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
httpClient → Client
An http.Client used to make an HTTP request.
no setterinherited
internalType String
INTERNAL: DO NOT USE
no setterinherited
internalWatch ↔ Watcher?
ONLY FOR FLUTTER DATA INTERNAL USE
getter/setter pairinherited
isInitialized bool
no setterinherited
keyManager KeyManager
A KeyManager that is used to obtain the encryption keys.
no setter
localAdapter → LocalAdapter<T>
finalinherited
offlineOperations Set<OfflineOperation<T>>
no setterinherited
ref → Ref<Object?>
Give access to the dependency injection system
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sodium → Sodium
The Sodium instance used to perform all cryptographic operations.
no setter
type String
The pluralized and downcased DataHelpers.getType<T> version of type T by default.
no setterinherited

Methods

clear() Future<void>
inherited
delete(Object model, {bool? remote, Map<String, dynamic>? params, Map<String, String>? headers, OnSuccessOne<T>? onSuccess, OnErrorOne<T>? onError, DataRequestLabel? label}) Future<T?>
inherited
deleteLocal(T model, {bool notify = true}) → void
inherited
deserialize(Object? data, {String? key}) → DeserializedData<T>
Returns a DeserializedData object when deserializing a given data.
dispose() → void
inherited
findAll({bool? remote, bool? background, Map<String, dynamic>? params, Map<String, String>? headers, bool? syncLocal, OnSuccessAll<T>? onSuccess, OnErrorAll<T>? onError, DataRequestLabel? label}) Future<List<T>>
inherited
findOne(Object id, {bool? remote, bool? background, Map<String, dynamic>? params, Map<String, String>? headers, OnSuccessOne<T>? onSuccess, OnErrorOne<T>? onError, DataRequestLabel? label}) Future<T?>
inherited
initialize({bool? remote, required Map<String, RemoteAdapter<DataModelMixin>> adapters, required Ref<Object?> ref}) Future<RemoteAdapter<T>>
inherited
isOfflineError(Object? error) bool
Determines whether error was an offline error.
inherited
keyForModelOrId(Object model) String
inherited
log(DataRequestLabel label, String message, {int logLevel = 1}) → void
inherited
methodForDelete(dynamic id, Map<String, dynamic> params) → DataRequestMethod
Returns HTTP method for delete. Defaults to DELETE.
inherited
methodForFindAll(Map<String, dynamic> params) → DataRequestMethod
Returns HTTP method for findAll. Defaults to GET.
inherited
methodForFindOne(dynamic id, Map<String, dynamic> params) → DataRequestMethod
Returns HTTP method for findOne. Defaults to GET.
inherited
methodForSave(dynamic id, Map<String, dynamic> params) → DataRequestMethod
Returns HTTP method for save. Defaults to PATCH if id is present, or POST otherwise.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onError<R>(DataException e, DataRequestLabel? label) FutureOr<R?>
Implements global request error handling.
inherited
onInitialized() Future<void>
inherited
onModelInitialized(T model) → void
After model initialization hook
inherited
onSuccess<R>(DataResponse response, DataRequestLabel label) FutureOr<R?>
inherited
save(T model, {bool? remote, Map<String, dynamic>? params, Map<String, String>? headers, OnSuccessOne<T>? onSuccess, OnErrorOne<T>? onError, DataRequestLabel? label}) Future<T>
inherited
saveLocal(T model, {bool notify = true}) → T
inherited
sendRequest<R>(Uri uri, {DataRequestMethod method = DataRequestMethod.GET, Map<String, String>? headers, Object? body, _OnSuccessGeneric<R>? onSuccess, _OnErrorGeneric<R>? onError, bool omitDefaultParams = false, bool returnBytes = false, DataRequestLabel? label, bool closeClientAfterRequest = true}) Future<R?>
The function used to perform an HTTP request and return an R.
inherited
serialize(T model) Map<String, dynamic>
Returns a serialized version of a model of T, as a Map<String, dynamic> ready to be JSON-encoded.
shouldLoadRemoteAll(bool remote, Map<String, dynamic> params, Map<String, String> headers) bool
Returns whether calling findAll should trigger a remote call.
inherited
shouldLoadRemoteOne(Object? id, bool remote, Map<String, dynamic> params, Map<String, String> headers) bool
Returns whether calling findOne should initiate an HTTP call.
inherited
toString() String
A string representation of this object.
inherited
urlForDelete(dynamic id, Map<String, dynamic> params) String
Returns URL for delete. Defaults to type/id.
inherited
urlForFindAll(Map<String, dynamic> params) String
Returns URL for findAll. Defaults to type.
inherited
urlForFindOne(dynamic id, Map<String, dynamic> params) String
Returns URL for findOne. Defaults to type/id.
inherited
urlForSave(dynamic id, Map<String, dynamic> params) String
Returns URL for save. Defaults to type/id (if id is present).
inherited
watchAllNotifier({bool? remote, Map<String, dynamic>? params, Map<String, String>? headers, bool? syncLocal, String? finder, DataRequestLabel? label}) → DataStateNotifier<List<T>>
inherited
watchOneNotifier(String key, {bool? remote, Map<String, dynamic>? params, Map<String, String>? headers, AlsoWatch<T>? alsoWatch, String? finder, DataRequestLabel? label}) → DataStateNotifier<T?>
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited