The Consent Management App is intended to be a mobile application that allows users to manage their personal healthcare data. The app is available for Android and iOS, and it has a backend that communicates with the Health-X dataspace.
For more details on the functionality and motivation behind the project, please read the project page.
If you're new to Flutter the first thing you'll need is to follow the setup instructions
Once Flutter is setup, you need access to an instance of the CMA Backend and a OIDC provider to use the features of this application.
Note: When running or building the app, you must specify which hosts to talk to. This is done by adding the
BASE_PATH,OIDC_ISSUERandOIDC_CLIENTcompilation environment declaration, which is picked up by the application. For the purpose of demonstration we use http://development.host.local:1234, http://oidc.host.local:1234 and CMA.
-
Clone the repository to your local machine:
git clone git@https://github.com/HEALTH-X-dataLOFT/consent-management-app.git
-
Navigate to the project directory:
cd consent-management-app -
Download image_magick_q16 package:
Download from GitHub image_magick_q16 package and put in a vendor/im folder
git clone [email protected]:Haidar0096/image_magick_q16.git vendor/im flutter pub get --directory vendor/im -
Install dependencies:
flutter pub get
The application can be started either via the cli or directly in the IDE. For more information about target devices and simulators for Android or iOS please read the Get started guide.
flutter run \
--dart-define="BASE_PATH=http://development.host.local:1234"In vscode you need to add configuration to your launch.json.
{
"version": "0.2.0",
"configurations": [
{
"name": "consent-management-app",
"request": "launch",
"type": "dart",
"toolArgs": [
"--dart-define",
"BASE_PATH=http://development.host.local:1234"
"--dart-define",
"OIDC_ISSUER=http://oidc.host.local:1234"
"--dart-define",
"OIDC_CLIENT=CMA"
]
}
]
}Some dependencies and tools rely on code generation as is common in Flutter development.
If you want to make changes to the application resource bundle files (.arb) in /localization folder, you'll need to update the generated code for flutter_localizations.
Just run the following command:
flutter gen-l10nIf you make changes to the routing of the application, you must regenerate the code for auto_route.
You can either run this once:
flutter packages pub run build_runner buildOr run a watcher that regenerates code on change:
flutter packages pub run build_runner watchIf the OpenAPI definition for the CMA Backend API has been updated, you need to regenerate the code for openapi-generator:
flutter pub run build_runner build --delete-conflicting-outputsFor detailed information check out the documentation on App Deployment
Note: You can build the app for different platforms, but at the moment we only support Android.
To build the app for Android, use the following command:
flutter build apk \
--dart-define="BASE_PATH=http://development.host.local:1234" \
--dart-define="OIDC_ISSUER=http://oidc.host.local:1234" \
--dart-define="OIDC_CLIENT=CMA"The APK file will be generated in the build/app/outputs/apk directory.