The source code for our video-on-demand app for iOS and Android. We would love your help! See https://developer.bcc.no/get-involved.html.
Recommended editor: VS Code, because we have some default debug options set up in launch.json.
- Clone the submodules with
git submodule update --init
. - Install flutter, then run
flutter doctor -v
until it reports everything is OK. - Run in a terminal:
flutter pub get
- Inside lib/env/, copy the .env.dart.template file to .env.dart, and update the values according to the comments.
- You can now run the app, e.g. with
flutter run --flavor prod
- For development, it's important to read the Code generation section below before you begin.
Some code is generated, for example routing and graphql queries. The generated files are often suffixed with .something.dart (e.g. .g.dart). To ensure your code is updated while developing, run the build_runner watcher:
dart run build_runner watch --delete-conflicting-outputs
- Android: "Unknown error" on login, issues with ssl, etc.: Sometimes the android emulator's clock goes out of sync. You can run this adb command to update the clock:
adb shell "su 0 date
date +%m%d%H%M%Y.%S"
We are using Maestro for end-to-end UI tests. See .maestro/README.md. These use a normal build of the app to test the most critical user flows, e.g. logging in and then playing the livestream. Most of the tests run during the release pipeline for the app.
You can find constants for colors, typography, etc. based on our design system under /lib/theme.
We are maintaining a standalone playback library to manage the player and chromecast code. It's located at /submodules/bccm_player which will be converted to a git submodule or pub.dev package at a later date.
We are using auto_route, but for deep linking we are using app_links, as it's less magical and more reliable than flutter's built-in solution for that.
We have some special routes, e.g. /r/, but these are only handled through a custom navigateNamedFromRoot()
function.
Schema files are copied from the platform repo.
To update the files easily, clone the brunstadtv repo so that it's located side-by-side with this repo, then run make copy-schema
(See the Makefile).
We are using Crowdin service for translations. In order to upload or download translations you need to have a personal token and the crowdin cli tool.
You need to put the token into a CROWDIN_TOKEN
environment variable.
Then you can run crowdin upload
or crowdin download
as needed.
After downloading the translations into the project you also need to run flutter gen-l10n
, which will generate .dart files in the same folder as the .arb files, based on /l10n.yaml.