8000 GitHub - anslabs/sglandtransport: Public (and private - soon) transport made easy
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

anslabs/sglandtransport

 
 

Repository files navigation

SG Land Transport

GitHub Build Status - Cirrus Build Status - Cirrus analyze Build Status - Cirrus unit_test Twitter handle

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)

Download official apps

Download on Google Play Download on App Store

Contributing

Refer to the Contributing Guidelines.

Code of Conduct

Our code of conduct is based on the Contributor Covenant.

Setup

Secret keys

LTA Datamall API key

This key is read during build time from an environment variable named "LTA_DATAMALL_API_KEY". Environment variables can be read in 2 ways:

  1. from command line:
flutter run ---dart-define=LTA_DATAMALL_API_KEY=<add your key here>
  1. 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"
      ]
    }
  ]
}

Google Firebase

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.

Prerequisites

Flutter

Code Generation

This project uses build runner to generate Models, Routes and other things.

Generate once

flutter pub run build_runner build --delete-conflicting-outputs

Watch and generate on change

flutter pub run build_runner watch --delete-conflicting-outputs

Running tests

Installing dependences

brew install lcov

Run tests, generate coverage files and convert to HTML

./prepare_test_coverage.sh lta_datamall_flutter
flutter test --coverage
lcov --list coverage/lcov.info
genhtml coverage/lcov.info --output=coverage

Run Integration (UI) Tests

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

Beta deployments

Deployments can be run from your local machine

iOS TestFlight:

cd ios
bundle exec fastlane beta

Android internal test track:

cd android
bundle exec fastlane deploy_internal

Production deployments

TBD

Screenshot Commandline utility

Installing dependencies

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"

Usage

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

Generate new set of app icon

  1. Place your icon app-icon.png image in images/ folder
  2. Run the following command flutter pub run flutter_launcher_icons:main

Maintainers

About

Public (and private - soon) transport made easy

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dart 83.1%
  • Ruby 15.8%
  • Other 1.1%
0