-
The UoNAfyaApp360 app runs on Flutter version 3.3.8. To check the flutter version and channel installed in your machine run
flutter --version
. -
To switch from another channel of Flutter to the stable channel run
flutter channel stable
. -
To install Flutter version 3.3.8 run
flutter version v3.3.8
.
Looks like we are done with the prerequisites :-)
This app is locked in portrait mode. Data shows that majority of our users will be accessing it via portrait mode hence
spending time and resources making it work in both portrait
and landscape
is an overkill.
To dig into the data. go to Stat Counter
Examples of apps serving the Kenyan market and doing well with portrait lock are Mpesa and Bolt.
-
Use
git clone [email protected]:savannahghi/pro_health_360.git
to clone this project. -
Navigate into the project directory.
-
Run
. set_up.sh
orsource set_up.sh
. This helps prevent you from pushing code that has linting errors. -
Easy, just run
flutter run
- Optionally, if you love using VS Code debugging tools, you can add this in your
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Dev mode",
"request": "launch",
"flutterMode": "debug",
"type": "dart",
"program": "lib/main.dart"
},
{
"name": "Release mode",
"request": "launch",
"flutterMode": "release",
"type": "dart",
"program": "lib/main_prod.dart"
}
]
}
run this on your terminal for the dev config
flutter run -t lib/main.dart --flavor dev
and this for the prod config
flutter run -t lib/bin/main_prod.dart --flavor prod
- Again, optionally, if you love using VS Code debugging tools, you can add this in your
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Flutter Dev",
"request": "launch",
"flutterMode": "debug",
"type": "dart",
"program": "lib/main.dart",
"args": ["--flavor", "dev"]
},
{
"name": "Flutter Release",
"request": "launch",
"flutterMode": "release",
"type": "dart",
"program": "lib/bin/main_prod.dart",
"args": ["--flavor", "prod"]
}
]
}
-
Next, you need to complete local keystore setup. For more information, visit app signing in the Android Developers blog
-
Run your emulator. See instructions on how to run an emulator.
-
Finally run the project running
flutter run
command on your terminal, or go toRun > Start Debugging
if you wish to run the app from VS code.
To run unit and widget tests, you will require to install lcov
by running sudo apt-get install lcov
in the terminal. Finally, run the following commands in the terminal:
-
From the root folder, run
flutter test --coverage test/
-
Run
genhtml -o coverage coverage/lcov.info
. This will generate ahtml
file which contains your coverage information. -
To view the coverage information, open the html file located at
coverage/index.html
with your favorite browser.
To run integration tests, ensure that you have an emulator running. See instructions on how to run an emulator.
- Then run
flutter drive --target=test_driver/app.dart
In order for you to run the application locally on your machine, you will need the following environment variables
- PROD_SENTRY_DNS and DEV_SENTRY_DNS that will be used to send error messages to your Sentry error reporting server
- DEV_STREAM_API_KEY, DEMO_STREAM_API_KEY and PROD_STREAM_API_KEY that will be used to enable you to connect to the GetStream API
If you want to add an environment variable to CI, you will need to run the following command to encode the ENV file into a string format. The --b 0
will prevent the new lines from being encoded
base64 --b 0 --i .env
In the CI configuration, you can decode the string into the ENV variable using this command which will decode the string into the ENV file
echo $ENCODED_APP_ENV | base64 --decode > .env