Public transport made easy, providing screens and functionality based on APIs that are exposed by the LTA Datamall (https://www.mytransport.sg/content/mytransport/home/dataMall.html)
Refer to the Contributing Guidelines.
Our code of conduct is based on the Contributor Covenant.
If you use VSCode, we recommend you create a launch.json file that launches the flutter run command with this argument, so that you can use the standard debug functionality of VSCode, rather than running your debug build via the command line.
Example launch.json file:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"request": "launch",
"type": "dart",
"args": [
"--dart-define=LTA_DATAMALL_API_KEY=<your LTA Datamall API key goes here>"
]
}
]
}
To run it from command line:
flutter run --dart-define=LTA_DATAMALL_API_KEY=<add your key here>
A key can be generated following the guildeines of
You can generate a key following the guidelines of the Land Transport Datamall.
Follow these instructions to add the necessary files related to Google Firebase services.
This project uses build runner to generate Models, Routes and other things.
flutter pub run build_runner build --delete-conflicting-outputs
flutter pub run build_runner watch --delete-conflicting-outputs
brew install lcov
./prepare_test_coverage.sh lta_datamall_flutter
flutter test --coverage
lcov --list coverage/lcov.info
genhtml coverage/lcov.info --output=coverage
flutter drive --target=test_driver/app.dart --dart-define=LTA_DATAMALL_API_KEY=<your LTA Datamall API key>
TBD
Ensure you have an SSH key properly set up. You can follow this guideline from GitHub. When creating the SSH key, ensure to leave the passphrase empty!
To test if you have the necessary rights and all is setup correctly, please try to run git clone git@github.com:bytecrumbs/certificates.git
, which should complete successfully, without prompting any passphrase.
Once the above works successfully, you can create a new Testflight version manually from your local machine using following steps:
# generate required files using build_runner
flutter pub run build_runner build --delete-conflicting-outputs
# ensure the tests are passing
flutter test
# ensure you have the correct fastlane version installed
cd ios
bundle install
# store the version number in an environment variable
RELEASE_VERSION=<version_number>
export RELEASE_VERSION
# configure App Store Connect API
ASCAPI_KEY_ID=<key_id>
export ASCAPI_KEY_ID
ASCAPI_ISSUER_ID=<issuer_id>
export ASCAPI_ISSUER_ID
ASCAPI_KEY_CONTENT=<key_content>
export ASCAPI_KEY_CONTENT
# set new version and build number
bundle exec fastlane set_release_version
# build a release version of the app
flutter build ios --release --no-codesign --dart-define=LTA_DATAMALL_API_KEY=<your LTA Datamall API key>
# upload the built version to Testflight
bundle exec fastlane beta
There is no need to push the changes that bundle exec fastlane set_release_version
has caused, you can savely discard those changes, as they will be overwritten again with above commands when the next build is produced.
cd ios
bundle exec fastlane testflight_from_ci
Note: Authentication with Apple services: Several Fastlane actions communicate with Apple services that need authentication. This can pose several challenges on CI. More info, use this link: https://docs.fastlane.tools/best-practices/continuous-integration/#application-specific-passwords
An Apple ID session is only valid for a certain region, meaning if your CI system is in a different region than your local machine, you might run into issues An Apple ID session is only valid for up to a month, meaning you'll have to generate a new session every month. Usually you'd only know about it when your build starts failing
- Set up fastlane and Add App Distribution to your fastlane configuration
bundle exec fastlane add_plugin firebase_app_distribution
- Authenticate With Firebase
curl -sL https://firebase.tools | bash
- Log into Firebase using your Google account
firebase login:ci
- Get the token and set FIREBASE_TOKEN
export FIREBASE_TOKEN=token_from_ci
cd android
bundle exec fastlane deploy_internal
cd ios
bundle exec fastlane submit_review
brew update && brew install imagemagick
pub global activate screenshots
Note: If pub is not found, add to PATH using:
On macOS:
export PATH="<path to flutter installation directory>/bin/cache/dart-sdk/bin:$PATH"
To create screenshots to upload via fastlane, run following command without any mode.
screenshots
If mode is recording, screenshots will be saved for later comparison
screenshots -m recording
If mode is archive, screenshots will be archived (and cannot be uploaded via fastlane).
screenshots -m archive
- Place your icon
app-icon.png
image inimages/
folder - Run the following command
flutter pub run flutter_launcher_icons:main