Add a package to a mono repository

https://bsky.app/profile/sander-roest.bsky.social
Search for a command to run...

https://bsky.app/profile/sander-roest.bsky.social
No comments yet. Be the first to comment.
Running flutter upgrade is not enough...

A necessity or a rip-off?

Both are used by humans, but they are not the same.

Recap part 1. In the previous article about this subject, I explained the limitations that I have ran into, with the default onDidRemovePage implementation. In this article I will show how I’ve overcome or better said, circumvented these limitations....
During the development of my RubigoRouter package I ran into some limitations of the Navigator object that I explain here below. The Flutter Navigator has a mechanism to inform the app about a back navigation event. Historically the onPopPage callbac...
In this part, we are going to add a package to an existing mono-repo.
Open a terminal and go to the packages folder.
cd ~/repos/0000000-demo_mono_repo_app-rubigo/packages
fvm flutter create -t package --org com.example --project-name my_package ./my_package
Android studio might not detect the new folder. Restarting Android Studio fixes that.
From now on we will use Android Studio to review and commit files.
Choose “Commit”
Android Studio => File -> Project Structure => Modules => + => Import Module
Navigate to my_package folder and choose “Open”. Be aware that the initial folder that Android Studio suggests might not be part of your current project.
Select “Create module from existing sources”, choose “Next”
Choose “Next”
Choose “Next”
Choose “OK”
Choose “Commit”
Open demo/mono/repo/app/pubspec.yaml and add my_package, and run pub get.

Choose “Commit”
If you change the line _counter++ to the sample here below, the demo app will use the package to add the values. Hot reload also works while you make changes to the implementation in my_package, which is awesome.

Choose “Commit”
These are all the steps that are needed to add a package to the mono-repo.