Use this as a template to get started with Flood.
Here are the steps to use this as a baseline for your project:
- Come up with a name for the project. It will be represented as {{NAME}} in the file examples below.
- Rename the
templatedirectory to {{NAME}} andtemplate_coreto {{NAME}}_core. - In pubspec.yaml, replace
templatewith {{NAME}}. - In {{NAME}}/pubspec.yaml, replace all instances of
templatewith {{NAME}}. - In {{NAME}}_core/pubspec.yaml, replace
templatewith {{NAME}}. - In melos.yaml, replace all
templates with {{NAME}} and set therepositoryto the url of your Github repository. - Replace every instance of
package:template_core/withpackage:{{NAME}}_core/andpackage:template/withpackage:{{NAME}/. - In {{NAME}}_core/tool/automate.dart, replace
Directory.current.parent / 'template'withDirectory.current.parent / '{{NAME}}'andcoreDirectory.parent / 'template'with `coreDirectory.parent / '{{NAME}}'. - Replace every instance of
com.example.templatewith your app identifier. - Do a project-wide search for any instances of
templateand replace them with what you need for your app. - Search for
TODOacross the project to find what steps you should take to customize the project.
Melos is a tool designed to manage Dart and Flutter projects with multiple packages, especially suited for big projects or projects which share common code across multiple apps.
To install Melos:
flutter pub global activate melos
Ensure your global pub cache is in your path, so you can run the melos command anywhere.
Bootstrapping in Melos is analogous to running flutter pub get for a regular Flutter project. While flutter pub get fetches and installs all the dependencies for a single Flutter project, Melos' bootstrapping process does something similar but on a larger scale for multi-package projects. It sets up your development environment by interlinking local package dependencies and populating them with their respective dependencies. This is especially useful for developing multiple interdependent packages within the same repository, ensuring they work seamlessly together.
To bootstrap your project with Melos, simply run:
melos bs
Testing your multi-package projects is simplified using Melos. Instead of running tests for each package individually, Melos can run them all at once.
To test your packages using Melos:
melos test
It will execute tests for all the packages in your project. Make sure you've bootstrapped your project before testing.