CarpService class
Provide access to a CARP web service endpoint.
The (current) assumption is that each Flutter app (using this library) will only connect to one CARP web service backend. Therefore a CarpService is a singleton and can be used like:
  CarpService().configure(myApp);
  CarpUser user = await CarpService()
    .authenticate(username: "user@dtu.dk", password: "password");
- Inheritance
 - 
    
- Object
 - CarpBaseService
 - CarpService
 
 
Constructors
- CarpService()
 - 
          Returns the singleton default instance of the CarpService.
Before this instance can be used, it must be configured using the
configure method.
            factory
 - CarpService.instance()
 
Properties
- app → CarpApp
 - 
  The CARP app associated with the CARP Web Service.
Returns 
nullif this service has not yet been configured via the configure method.no setteroverride - appAuth ↔ FlutterAppAuth
 - 
  
  getter/setter pair
 - authEndpointUri → Uri
 - 
  The URI for the authenticated endpoint for this CarpService.
  no setter
 - authenticated → bool
 - 
  Is a user authenticated?
If 
true, the authenticated user is currentUser.no setter - 
  authStateChanges
  → Stream<
AuthEvent>  - 
  Notifies about changes to the user's authentication state (such as sign-in or
sign-out) as defined in AuthEvent.
  no setter
 - consentDocumentEndpointUri → String
 - 
  The URL for the consent document end point for this CarpService.
  no setter
 - currentUser ↔ CarpUser
 - 
  Gets the current user.
Returns 
nullif no user is authenticated.getter/setter pairoverride-getter - documentEndpointUri → String
 - 
  The URL for the document end point for this CarpService.
  no setter
 - fileEndpointUri → String
 - 
  The URL for the file end point for this CarpService.
  no setter
 - hashCode → int
 - 
  The hash code for this object.
  no setterinherited
 - 
  headers
  → Map<
String, String>  - 
  The headers for any authenticated HTTP REST call to this CarpService.
  no setteroverride
 - isConfigured → bool
 - 
  Has this service been configured?
  no setterinherited
 - rpcEndpointName → String
 - 
  The endpoint name for this service at CARP.
  no setteroverride
 - rpcEndpointUri → String
 - 
  The URL for this service's endpoint at CARP.
  no setterinherited
 - runtimeType → Type
 - 
  A representation of the runtime type of the object.
  no setterinherited
 
Methods
- 
  authenticate(
) → Future< CarpUser>  - Authenticate to this CARP service using a BuildContext, that opens the authentication page of the Identity Server using a secure web view from the OS.
 - 
  authenticateWithDialog(
) → Future< CarpUser>  - 
  authenticateWithRefreshToken(
String refreshToken) → Future< CarpUser>  - 
  authenticateWithToken(
{required CarpUser user, required OAuthToken token}) → CarpUser  - Authenticate to this CARP Service using a OAuthToken access token and a CarpUser. This method is typically used to re-authenticate a user based on a previously granted access token, for example when the app is restarted.
 - 
  authenticateWithUsernamePassword(
{required String username, required String password}) → Future< CarpUser>  - 
  Authenticate to this CARP service using a 
usernameandpassword. - 
  authenticateWithUsernamePasswordNoContext(
{required String username, required String password}) → Future< CarpUser>  - 
  Authenticate to this CARP service using a 
usernameandpassword. - 
  collection(
String path) → CollectionReference  - 
  Gets a CollectionReference for the specified 
path. - 
  configure(
CarpApp app) → void  - 
  Configure the this instance of a Carp Service.
  inherited
 - 
  configureFrom(
CarpBaseService service) → void  - 
  Configure from another 
servicewhich has already been configured and potentially authenticated.inherited - 
  convertToTokenResponse(
Map< String, dynamic> json) → TokenResponse - 
  createConsentDocument(
Map< String, dynamic> document) → Future<ConsentDocument>  - Create a new (signed) consent document for this user. Returns the created ConsentDocument if the document is uploaded correctly.
 - 
  document(
String path) → DocumentReference  - 
  Gets a DocumentReference for the specified 
path. - 
  documentById(
int id) → DocumentReference  - Gets a DocumentReference for the specified unique id.
 - 
  documents(
) → Future< List< DocumentSnapshot> > - Get all documents for this study.
 - 
  documentsByQuery(
String query) → Future< List< DocumentSnapshot> > - Get a list documents based on a query.
 - 
  getAllFiles(
) → Future< List< CarpFileResponse> > - Get all file objects in the study.
 - 
  getConsentDocument(
int id) → Future< ConsentDocument>  - 
  Get a previously uploaded (signed) ConsentDocument based on its 
id. - 
  getCurrentUserProfile(
TokenResponse response) → CarpUser  - Gets the CARP profile of the current user from the JWT token
 - 
  getDataPointReference(
) → DataPointReference  - Creates a new DataPointReference initialized at the current CarpService storage location.
 - 
  getFileStorageReference(
[int id = -1]) → FileStorageReference  - 
  Get a FileStorageReference that reference a file at the current
CarpService storage location.
idcan be omitted if a local file is not uploaded yet. - 
  getFileStorageReferenceByName(
String name) → Future< FileStorageReference?>  - 
  Get a FileStorageReference that reference a file with the original name
nameat the current CarpService storage location. - 
  logout(
) → Future< void>  - Log out of this CARP service using a BuildContext, that opens a web view to clear cookies and end the sesion on the Identity Server.
 - 
  logoutNoContext(
) → Future< void>  - Logs out of this CarpService, by clearing the current user.
 - 
  nonNullAble<
T> (T? argument) → T  - Makes sure that the CarpApp or CarpUser is configured, by throwing a CarpServiceException if they are null. Otherwise, returns the non-null value.
 - 
  noSuchMethod(
Invocation invocation) → dynamic  - 
  Invoked when a nonexistent method or property is accessed.
  inherited
 - 
  queryFiles(
[String? query]) → Future< List< CarpFileResponse> > - 
  Returns file objects in the study based on a 
query. - 
  refresh(
) → Future< CarpUser>  - Get a new access token for the current user based on the previously granted refresh token, using the Identity Server discovery URL.
 - 
  refreshNoContext(
) → Future< CarpUser>  - Get a new access token for the current user based on the previously granted refresh token, using the Identity Server discovery URL. Need to have run any of the authenticate functions first.
 - 
  sendForgottenPasswordEmail(
) → Future< String>  - 
  toString(
) → String  - 
  A string representation of this object.
  inherited
 
Operators
- 
  operator ==(
Object other) → bool  - 
  The equality operator.
  inherited