Publc 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.
This key is read during build time from an environment variable named "LTA_DATAMALL_API_KEY". Environment variables can be read in 2 ways:
- from command line:
flutter run ---dart-define=LTA_DATAMALL_API_KEY=<add your key here>
- From an environment variable on your CI server (see this project's .cirrus.yml file for an example)
You can generate a key following the guidelines of https://www.mytransport.sg/content/mytransport/home/dataMall/dynamic-data.html
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"
]
}
]
}
Follow the instructions on https://firebase.google.com/docs/flutter/setup?platform=ios (as well as for Android) 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=IS_FLUTTER_DRIVE_RUN=true --dart-define=LTA_DATAMALL_API_KEY=<your LTA Datamall API key>
IMPORTANT NOTE: above argument '--dart-define=IS_FLUTTER_DRIVE_RUN=true'. This is used so that in the code we can check if the app is run using flutter drive and therefore some specific checks can be made (i.e. the flare animation will not animate when running 'flutter drive')
Alternatively, refer to the Screenshots section below, which will run the same integration tests as well.
Deployments can be run from your local machine
cd ios
bundle exec fastlane beta
cd android
bundle exec fastlane deploy_internal
TBD
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