Richard Coutts
Thanks for dropping by! Dreamalytics is my latest distraction—a dream logging app partially funded by an NSERC microgrant.
Dreamalytics was built by yours truly using my custom libraries below.
StatefulWidgets are great. They render UI and hold mutable state. They do it all. Only, StatefulWidgets are not great at separating UI from state.
That’s where MVVM+ comes in.
MVVM+ implements the model-view-view model pattern by adding a pinch of syntactic sugar to StatefulWidget to separate its mutable states into a ViewModel class and its UI into a View class.
For more information on MVVM+, check out its documentation on pub.dev. It’s not necessary to know the underpinnings of how MVVM+ works, but if you like to wade in the weeds, check out my Medium article, How to Extend a StatefulWidget into an MVVM Workhorse.
InheritedWidgets scope data on the widget tree (like Provider, ScopedModel). To access models on different branches, you can instead add your model to a global registry (like GetIt).
Wouldn’t it be nice to have a single library that organizes both inherited models and single services? That’s the idea behind Bilocator.
You add Bilocator widgets to your widget tree that manage your single services and your inherited models . For times when you need inherited models briefly be globally available (e.g., you want to fire up an editor on a different branch), you simply register your inherited model and unregister it when you’re done.
For more information on Bilocator, check out its documentation on pub.dev.
Let’s face it. Writing widget tests can be tedious. That’s where package:approved comes to the rescue.
Package:approved is an implementation of approval tests. With a single function call, you capture your widget states to file for review and approval. So, writing and maintaining unit, widget, and integration tests is simpler and faster.
For more information on package:approved, see its documentation on pub.dev.