This package serves as a Flutter wrapper around all FibriCheck cloud services.
To get started with the FibriCheck SDK you'll need to install it, and then get credentials which will allow you to access the backend.
Installation
In your project, you can add the package below to the pubspec.yaml file. Replace {TOKEN} with your personal access token. You can get a new one here. Make sure you enable the repo scope.
The client method (default export) supports several options you may set to achieve the expected behavior:
For the env, Env.dev or Env.production enumeration from the library flutter_fibricheck_sdk can be used.
API
When you initialize the sdk, the returned object will have the following methods available.
classFLFibricheckSDK {/// Create an account based on a [UserRegisterData] object /// and returns [UserData] of the created user /// /// can throw [EmailUsedError]Future<UserData> register(UserRegisterData data) async {}/// Authenticate with an [ParamsOauth1WithToken] object and returns a /// [TokenDataOauth1] object /// /// can throw [ApplicationNotAuthenticatedError], [AuthenticationError], /// [LoginTimeoutError], [LoginFreezeError], [TooManyFailedAttemptsError], [MfaRequiredError]Future<TokenDataOauth1> authenticateWithToken(ParamsOauth1WithToken credentials, voidFunction(List<Consent> consents) onConsentNeeded) async {}/// Authenticate with an [ParamsOauth1WithEmail] object and returns a /// [TokenDataOauth1] object /// /// can throw [ApplicationNotAuthenticatedError], [AuthenticationError], /// [LoginTimeoutError], [LoginFreezeError], [TooManyFailedAttemptsError], [MfaRequiredError]Future<TokenDataOauth1> authenticateWithEmail(ParamsOauth1WithEmail credentials, voidFunction(List<Consent> consents) onConsentNeeded) async {}/// Clears oauth session databoollogout() {}/// Gives consent based on a [Consent] object /// Returns the number of affected recordsFuture<int> giveConsent(Consent consent) async {}/// Send a measurement to the cloud Future<Measurement> postMeasurement(MeasurementCreationData measurementCreationData, String cameraSdkVersion) async {}
/// Check if the user is entitled to perform a measurementFuture<bool> canPerformMeasurement() async {}/// Updates the measurement context for a given measurement idFuture<int> updateMeasurementContext(String measurementId, MeasurementContext measurementContext) async {}/// Update the user profile of the [userId] provided /// with the given [ProfileData] and returns the number of affected recordsFuture<int> updateProfile(String userId, ProfileData updateData) async {}/// Get a measurement based on a [measurementId]Future<Measurement> getMeasurement(String measurementId) async {/// Get all measurements of the current userFuture<PagedMeasurementResult> getMeasurements(bool newestFirst) async {}/// Returns a measurement report url for the given measurement id /// or creates one if it not yet exists.Future<String> getMeasurementReportUrl(String measurementId) async {}/// Returns a list of periodic reportsFuture<PagedPeriodicReportsResult> getPeriodicReports(bool newestFirst) async {}/// Returns the pdf of a periodic report as a stringFuture<String> getPeriodicReportPdf(String reportId) async {}///Activates a prescription hash, so the user can perform a measurementFutureactivatePrescription(String hash) async {}/// Return the general configuration as a [GeneralConfiguration].Future<GeneralConfiguration> getGeneralConfiguration() async {}/// Return the user configuration as a [UserConfiguration].Future<UserConfiguration> getUserConfiguration() async {}/// Update the user with the id [userId] configuration. /// The [key] is the key where to save the value for the user. /// The [value] is an object that can be jsonEncoded. /// Return true if the update was done successfully.Future<bool> updateUserConfig(String key, Object value) async {}}