Skip to content

kevintpf/sample_adaptive

Repository files navigation

Test App

Test app built with mason


First Steps

Welcome to your new Flutter app! Here are some steps you need to take before starting working on this project:

  1. If you are using Android Studio or IntelliJ IDEA, Open "Settings > Languages & Frameworks > Flutter" and configure your Flutter SDK path.
  2. Run the app in an iOS device, so the xcode configurations can be updated.
  3. Open the ios folder with Xcode and configure the development team for all flavours. You can find this setting under Targets > Runner > Signing & Capabilities.
  4. If the app uses encryption algorithms that are not part of the device OS, remove this ios configuration: ITSAppUsesNonExemptEncryption.
  5. Search for "TODO(init)" in this project and follow their instructions. Delete the "TODO" comments afterwards.
  6. Delete this section from the README.

Getting Started 🚀

This project contains 3 flavors:

  • development
  • staging
  • production

To run the desired flavor either use the launch configuration in VSCode / Android Studio or use the following commands:

# Development
$ flutter run --flavor development --target lib/main_development.dart

# Staging
$ flutter run --flavor staging --target lib/main_staging.dart

# Production
$ flutter run --flavor production --target lib/main_production.dart

TODO(init): Update the platforms this project will work: *Test App works on Android, iOS, Windows, Linux and Web.

This project contains auto-generated code, and the code generator needs to be invoked everytime there's a change in annotated code.

To run the code generator, execute the following command:

# For a one-off build
dart run build_runner build -d
# For constantly building automatically as the code changes
dart run build_runner watch -d

Adding assets

The project uses flutter_gen for generating an Assets class with all the assets' paths. If you add a new asset into the asset directory (Don't forget to add the folders into pubspec.yaml), you must also run build_runner so the Assets class can be updated with the new references.


Data Models

Data is modelled for use with Bloc & Cubits using the Freezed pub package. In order to generate the freezed classes, see the code generation section above.

TODO(mfeinstein): expand this to include architecture.


Running Tests 🧪

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

Firebase

The Firebase setup should be made using the flutterfire_cli. In order to generate all the projects for all the flavours, you should update the missing details in the script tool\firebase\firebase_config.sh, then run it. Be sure to have the proper credentials and have the correct Firebase account logged in the firebase CLI, otherwise the projects will be created in another account and project IDs must be unique, which will make the work of creating them again, or transfering a lot harder.

The script doesn't include the option --debug-symbols-ios because we don't use Crashlytics.

Guidance

If you need any kind of guidance on how to develop or structure a feature, the goshorty_flutter project is a good reference to have in mind. The project is well strucutured and covers lots of different paradigms.

Take a look at the project before making final decisions, it can change how you will shape your final solution for the best.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors