
Flutter — Micro Apps
…a recent trend of breaking up frontend monoliths into many smaller, more manageable pieces, and how this architecture can increase the effectiveness and efficiency of teams working on frontend code…
In an earlier article I talked about packaging code to share it with other applications.
Micro Apps(Frontends) takes that a step further allowing me to compose applications from applications.
I wanted to be able to share the startup screens and logic to detect the device, set the theme based on brightness mode etc.. with other applications.
I looked at a package flutter_micro_app, but I felt it introduced too much additional code, especially around cross application routing and comms.
The simplest approach was to use packages and move the screens into a new package called digestable_prologue.
Ta Da
New package digestable_prologue, with all the start up screens moved from digestibleme:

Then added back to digestibleme:

And wired up in main:

Note, Riverpod is used to override the tab items when the application starts which is what the new app package will used once it finishes bootstrapping the app and that’s it!
XP
Separation and coupling
Moving the startup code, meant that digestibleme the main app is less cluttered with a focus on its features and only has a loose dependency on the startup application.
The feature tests for each are now separate which is important for scale and maintainability.


Keeping package versions inline
When the reference to the version in simbucore differed in digestibleme and digestable_prologue I got an error that was not very helpful:
Failed assertion: line 4268 pos 12: '!_dirty': is not true.So you need to be careful and make sure that packages that are depended on multiple times by parts of your application are the same version.
If you remember to bump the version or automate the increment you can check with:
flutter pub depsIf not you can find the git check id using the upgrade command:
flutter pub upgrade simbucore
simbucore 0.0.1 from git https://gitlab.com/simbu-mobile/simbucore.git at 85f703





