CarpResourceManager class

Implementation of InformedConsentManager, LocalizationManager, and MessageManager in the CARP service.

Also supports local caching of these resources locally on the phone (except for messages, which is assumed to be handled by the app).

Implemented types

Constructors

CarpResourceManager()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
informedConsent ↔ RPOrderedTask?
The latest downloaded informed consent document.
getter/setter pairoverride-getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

deleteAllMessages() Future<void>
Deletes all messages.
override
deleteInformedConsent() Future<bool>
Delete the informed consent for this study.
override
deleteLocalizations(Locale locale) Future<bool>
Delete the localization for the locale.
override
deleteMessage(String messageId) Future<void>
Delete a message based on its id (i.e., document name on CARP).
override
getInformedConsent({bool refresh = false}) Future<RPOrderedTask?>
Get the informed consent to be shown for this study.
override
getLocalizations(Locale locale, {bool refresh = false, bool cache = true}) Future<Map<String, String>?>
Get localization mapping as json for the specified locale.
override
getMessage(String messageId) Future<Message?>
Get a message based on its id.
override
getMessages({DateTime? start, DateTime? end, int? count = 20}) Future<List<Message>>
Get a list of messages in a given time period from start to end with a maximum of count messages.
override
initialize() Future<void>
override
isSupported(Locale locale) bool
Whether resources for the given locale can be loaded by this manager.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setInformedConsent(RPOrderedTask informedConsent) Future<bool>
Set the informed consent to be used for this study.
override
setLocalizations(Locale locale, Map<String, dynamic> localizations) Future<bool>
Set localization mapping for the specified locale.
override
setMessage(Message message) Future<void>
Set a message.
override
toString() String
A string representation of this object.
inherited

Operators

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

Constants

LOCALIZATION_PATH → const String
The path for the language documents at the CARP server. Each language locale has its own document
MESSAGES_PATH → const String
The base path for messages - both on the CARP server and locally on the phone
RESOURCE_PATH → const String
The base path for resources - both on the CARP server and locally on the phone