QAFlutterPlugin class
Main QA entry point.
Constructors
- QAFlutterPlugin()
- Singleton initialization.
Properties
-
basicInfo
→ Future<
BasicInfo> -
BasicInfo for the current user
no setter
-
deviceId
→ Future<
String> -
ID of the device
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
identityId
→ Future<
String> -
The method is only relevant for Android
User identity id
no setter
-
isKeyboardAdded
→ Future<
bool?> -
The method is only relevant for iOS
A boolean indicating if the keyboard is added in the system Keyboards settings.
It determines whether the keyboard is added or not based on KEYBOARD_EXTENSION_BUNDLE_ID field
from Info.plist file of the keyboard companion app.
Returns nil if the KEYBOARD_EXTENSION_BUNDLE_ID is not added to the Info.plist file properly.
no setter
-
keyboardSettings
→ Future<
KeyboardSettings> -
KeyboardSettings
no setter
-
password
→ Future<
String?> -
User password
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
canActivity(
) → Future< bool> -
The method is only relevant for Android
Returns whether or not the
activity recognitionpermission has been granted -
canDraw(
) → Future< bool> -
The method is only relevant for Android
Returns whether or not the
draw over other appspermission has been granted -
canUsage(
) → Future< bool> -
The method is only relevant for Android
Returns whether or not the
usagepermission has been granted -
coreMotionAuthorizationStatus(
) → Future< AuthorizationStatus> - CoreMotion AuthorizationStatus
-
deleteJournalEntry(
{required String id}) → Future< void> - Use this function to delete a journal entry. You need to provide the id of the entry you want to delete, checkout getJournalEntries and JournalEntryWithEvents to see how to retrieve the id of the entry to delete.
-
getCohortList(
) → Stream< List< Cohort> > - Retrieves the list of studies the device is currently registered for.
-
getConnectedDevices(
) → Future< List> - Retrieves the list of paired devices
-
getJournalEntries(
) → Stream< List< JournalEntry> > - This functions returns the full journal of the device, meaning all entries with the corresponding events. Checkout JournalEntryWithEvents for a complete description of how the journal entries are organized.
-
getJournalEntriesSample(
{required String apiKey}) → Future< List< JournalEntry> > - This functions returns a fictitious journal and can be used for test/display purposes, Checkout JournalEntryWithEvents for a complete description of how the journal entries are organized.
-
getJournalEntry(
String journalEntryId) → Future< JournalEntry?> - Use this function to retrieve a particular journal entry. You need to provide the id of the entry you want to retrieve, checkout getJournalEntries and JournalEntryWithEvents to see how to retrieve the id of the entry.
-
getJournalEventKinds(
) → Future< List< JournalEventEntity> > - Retrieves the Journal events, meaning the events that one can log together with a journal entry. The events come from a fixed set which may be updated in the future, this function return the latest update to the JournalEventEntity.
-
getLastTaps(
{required int backwardDays}) → Future< int> - Retrieves last taps in requested backward time
-
getMetric(
{required MetricType metric, required MetricInterval interval, bool refresh = false}) → Stream< TimeSeries> - Get a QA metric relative to the device in use. Check the the list of available metrics from Metric or Trend. The function returns an object of type TimeSeries which contains timestamps and values of the requested metric. The call is asynchronous ans returns a flow.
-
getMetricSample(
{required String apiKey, required MetricType metric, required MetricInterval interval}) → Stream< TimeSeries> - Get a QA metric relative to a fictitious test device. Check the the list of available metrics from Metric or Trend. The function returns an object of type TimeSeries which contains timestamps and values of the requested metric. The call is asynchronous ans returns a flow. You can use this function to test your data workflow and visualization.
-
getQuestionnairesList(
) → Stream< List< Questionnaire> > - Get a list of all the questionnaires available to complete (across all the studies to which a device is subscribed to).
-
getStatSampleAsync(
{required String apiKey, required MetricType metric}) → Future< TimeSeries?> - Asynchronous version of getMetricSample. The functionality is identical except that it implements it with a coroutine logic instead of a flow logic. Can be used in cases where coroutines can be executed and flow are not necessary, e.g. background update tasks.
-
getSubscriptions(
) → Future< List< Subscription> > - Returns an object of type Subscription that contains the subscription ID of the cohort to which the device is currently subscribed to, if multiple devices are subscribed using the same subscriptionId it returns all the device IDs.
-
init(
{required String apiKey, int? yearOfBirth, Gender? gender, bool? selfDeclaredHealthy, String? identityId, String? password}) → Future< bool> - The first time you use the QA SDK in the code you should initialize it, this allows the SDK to create a unique identifier and initiate server transactions and workflows. Most of the functionality will not work if you have never initialized the singleton before.
-
isDataCollectionRunning(
) → Future< bool> - The method is only relevant for Android This function check that the data collection is currently running.
-
isDeviceRegistered(
) → Future< bool> - Return whether the device is registered or not.
-
isHealthKitAuthorizationStatusDetermined(
) → Future< bool> - Indicates whether a user was already asked for HealthKit permissions required by the SDK. Returns true if user was asked for permission by displaying system popup.
-
leaveCohort(
String subscriptionId, String cohortId) → Future< void> - Use this to withdraw the device from a particular cohort.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openBatteryOptimisationSettings(
) → Future< void> -
Android onlyUse this function to open the battery optimization settings and prompt the user to disable them such that the background process is not killed -
openDrawSettings(
) → Future< bool> -
The method is only relevant for Android
Opens device settings to grant the
drawpermission -
openUsageSettings(
) → Future< bool> -
The method is only relevant for Android
Opens device settings to grant the
usagepermission -
pauseDataCollection(
) → Future< void> - Pause the data collection.
-
recordQuestionnaireResponse(
{String? name, String? code, DateTime? date, String? fullId, String? response}) → Future< void> - Saves a questionnaire response.
-
requestCoreMotionAuthorization(
) → Future< bool> - Requests permission to read CoreMotion (Motion Activity) data requiered by the SDK.
-
requestHealthKitAuthorization(
) → Future< bool> - Requests permission to read HealthKit data requiered by the SDK.
-
resumeDataCollection(
) → Future< void> - Restart the data collection after it has been purposely paused.
-
saveJournalEntry(
{String? id, required DateTime date, required String note, required List< JournalEvent> events}) → Future<JournalEntry> - Use this utility function to create or edit a journal entry. In case you want to edit a note you will need to pass the ID of the entity to edit. The function returns an asynchronous flow with the response of the action. The response is mostly to trigger UI/UX events, in case of failure the SDK will take care internally of retrying.
-
sendNote(
String text) → Future< void> - Saves simple text note.
-
subscribe(
{required String subscriptionIdOrCohortId}) → Future< SubscriptionWithQuestionnaires> - Use this function to subscribe the device to your(one of your) cohort(s).
-
syncData(
) → Future< void> - Sync Data
-
toString(
) → String -
A string representation of this object.
inherited
-
updateBasicInfo(
{int? newYearOfBirth, Gender? newGender, bool? newSelfDeclaredHealthy}) → Future< void> - Use this function to update the basic info of a user. You can call the function with one or parameters, the missing ones will be considered unaltered.
-
updateFCMToken(
{required String token}) → Future< void> - Updates current keyboard settings. See KeyboardSettings fields for more details.
-
updateKeyboardSettings(
{required KeyboardSettings keyboardSettings}) → Future< void> - Updates current keyboard settings. See KeyboardSettings fields for more details.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited