D
ArchitectureMedium30 XP3 min read

What are the trade-offs between monorepo and multi-repo for Flutter projects?

TL;DR: Monorepo: single Git repository for all packages/apps. Easier code sharing and atomic commits across packages. Multi-repo: each package is its own repo. Better for strict access control and independent versioning. Most Flutter teams with 2+ apps choose monorepo.

Full Answer

AspectMonorepoMulti-repo
Code sharingEasy — local path dependenciesHard — publish to pub.dev or private registry
Atomic changesYes — one PR changes all packagesNo — multiple PRs, sync issues
CI speedSlower unless smart caching (melos)Faster — each repo CI is independent
Access controlAll or nothing per teamGranular per repo
VersioningManaged by melos (semantic-release)Independent per package
🎯

Monorepo is the clear winner when you have a mobile app + BFF API + shared models. Use melos + Dart workspace for pub sharing without publishing to pub.dev.

Code Examples

yamlDart workspace (pub.dev alternative for monorepo)
Output
# dart pub get at root resolves all workspace packages together
# No need to publish to pub.dev for internal packages

Common Mistakes

  • Not setting up caching in CI for monorepos — every package gets rebuilt on every PR without smart invalidation
  • Using monorepo without tooling (melos) — manual dependency updates across 10 packages is a nightmare

Interview Tip

💡

Google, Facebook, and Airbnb all use monorepos at scale. Mention that Dart 3.5+ added native workspace support (dart pub workspace) which reduces the need for melos for basic setups.

#monorepo#multi-repo#ci-cd#code-sharing