This repository contains the Catalyst Voices app and packages.
- flutter: 3.24.1+
- Dart: 3.5.0+
- Ruby: 2.5+
- Xcode: 15.0+
- Android Studio: Android Studio Electric Eel | 2022.1.1 +
- Android SDK: 23+
- iOS SDK: 15.0+
- Melos
- Fastlane
- Flutter & Dart plugins:
❗️We recommend using Visual Studio Code as the default editor for this project.
git clone https://github.com/input-output-hk/catalyst-voices.git
cd catalyst_voices
just bootstrap
Package | Description | Example |
---|---|---|
catalyst_voices_assets | Assets used in Catalyst Voices | example |
catalyst_voices_blocs | State management of Catalyst Voices | example |
catalyst_voices_localization | Localization files for Catalyst Voices | example |
catalyst_voices_models | Models | example |
catalyst_voices_repositories | Repositories | example |
catalyst_voices_services | Services | example |
catalyst_voices_shared | Shared code | example |
catalyst_voices_view_models | ViewModels | example |
This project contains four flavors:
- dev
- qa
- preprod
- prod
To run the desired flavor, either use the launch configuration in VSCode/Android Studio or use the following commands:
# Development
flutter run --flavor dev --target apps/voices/lib/configs/main_dev.dart
# QA
flutter run --flavor qa --target apps/voices/lib/configs/main_qa.dart
# Pre-Production
flutter run --flavor preprod --target apps/voices/lib/configs/main_preprod.dart
# Production
flutter run --flavor prod --target apps/voices/lib/configs/main_prod.dart
Catalyst Voices works on the Web only. We plan to add support for other targets later.
We use dart defines to manage environment variables.
For example if you need to pass SENTRY_DSN
as environment variable,
you can use the following command:
flutter build web --target apps/voices/lib/configs/main_web.dart --dart-define SENTRY_DSN=REPLACE_WITH_SENTRY_DSN_URL
This project utilizes automatic code generation for the following components:
- Catalyst Gateway OpenAPI
- Localization files
- Asset files
- Navigation route files
To generate code, run the following command in the root directory:
earthly ./catalyst_voices+code-generator
To save the generated code locally, use the --save_locally
flag:
earthly ./catalyst_voices+code-generator --save_locally=true
Important A valid GITHUB_TOKEN
/ PAT
is required to run the earthly target.
Token Configuration:
- Locate the
.secret.template
file in the root directory - Create a copy of this file and name it
.secret
- Add your
GITHUB_TOKEN
to the.secret
file
- The
.secret
file should be included in.gitignore
- Verify that git does not track the
.secret
file before committing
To run all unit and widget tests use the following command:
flutter test --coverage --test-randomize-ordering-seed random
To view the generated coverage report you can use lcov.
# Generate Coverage Report
genhtml coverage/lcov.info -o coverage/
# Open Coverage Report
open coverage/index.html
- Mixed dependencies from a hosted repository and local path:
Because every version of catalyst_cardano_web from path depends on catalyst_cardano_serialization
from hosted and catalyst_voices depends on catalyst_cardano_serialization from path,
catalyst_cardano_web from path is forbidden.
So, because catalyst_voices depends on catalyst_cardano_web from path, version solving failed.
Solution:
When adding a new local dependency, hosted repository (i.e. pub.dev) should be preferred over local paths.
However to make it easier to depend on local changes use melos bootstrap
to generate pubspec_overrides.yaml
.
This allows to publish the source code on remote repository that points to official dependency versions
but use local changes during regular development.
The issue appears if you have added a new dependency or pulled code that adds dependency and you haven't run melos bootstrap
.
See Melos.