This document provides an overview of the Flutter development process, including the steps involved in building a Flutter application.
Before starting the Flutter development process, ensure that you have the following:
Clone and start this project
$ git clone https://github.com/Rekindle-Learning/rekindle-flutter.git
$ flutter pub get
To copy the required client assets into their path, run the copy-clientfiles script with the selected <client>.
rekindle:Windows:
./copy-clientfiles.bat app
Mac:
./copy-clientfiles.sh app
To use a different client, simply change the app name ie. ./copy-clientfiles.sh agsa
Locate the Flutter folder in your system:
flutter\bin\cache and remove a file named: flutter_tools.stampflutter\packages\flutter_tools\lib\src\web and open the file chrome.dart'--disable-extensions', in that file'--disable-web-security', below the previous lineMake sure you have the Firebase CLI installed, otherwise run:
npm install -g firebase-tools
Next, install the FlutterFire CLI by running the following command:
dart pub global activate flutterfire_cli
Important: As the project expects to find
firebase_options_productionandfirebase_options_stagingfiles under/lib/firebase/it is important to run the provided bash script. Remember to run it for staging and production for the first time.
Navigate to the project directory and run the following script to download the GoogleService-Info.plist file for the specified flavor and environment.
./create-firebase-app.sh <flavor> <environment>
Replace <flavor> with the name of your app (e.g., agsa, app, etc.) and <environment> with the environment you are testing (e.g., staging or production).
To download the Firebase configuration for the agsa flavor in the staging environment, run:
./create-firebase-app.sh agsa staging
Verify that the google-services.json file has been downloaded to the appropriate directory within your Flutter project.
It should be located under android/app/src/<flavor>/google-services.json.
Ensure that the Firebase configurations are correctly set up for each flavor and environment.
We recommend to run the app using the launch.json configuration if you are using VSCode.
You can also use the following script to run the staging flutter app
flutter run --dart-define=DEFINE_ENV=staging --dart-define=DEFINE_HOST=portal.rekindleapps.com --dart-define=DEFINE_TARGET=web --dart-define=DEFINE_SLUG=agsa
Run the flutter app pointing to the “dummy organisation” in the production app
flutter run --dart-define=DEFINE_ENV=production --dart-define=DEFINE_HOST=portal.rekindlelearning.com --dart-define=DEFINE_SLUG=crosshill
Write unit tests using the Flutter testing framework. Perform integration testing to ensure different components work together. Conduct manual testing on real devices to identify any issues.
To Run Unit Tests in Flutter:
$ flutter test
brew install imagemagick.