We made this library to combine and standarize the common code we use in our projects into a single package.
Feel free to use it, but on your own risk.
WARNING: This package may have drastic breaking changes with no migration guides.
Features
View-Controller architecture with helper classes
BdayaLoggableMixin
: provides a uniquelogger
BdayaLifeCycleMixin
: provides life cycle management for controllers usingbeforeRender
: same asinitState
for stateful widgetsafterRender
: gets called after a single frame has been rendered, which is useful for accessing states inGlobalKey
sonDispose
: same asdispose
for stateful widgets
BdayaIsLoadingMixin
: exposes reactiveisLoading
BdayaStreamHandlerMixin
: useful for managingStream
andListenable
subscriptions
Hooks using flutter_hooks
useViewController
: registers alazySingleton
controller, and if it usesBdayaLifeCycleMixin
, fires the related events
Routing helpers using go_router
RouterListenableMixin
listens toGoRouter
for changes to the current route, and notifies the controller about them
Combined controllers for all of the above
BdayaCombinedController
suitable for any widget, mixesBdayaLoggableMixin
BdayaLifeCycleMixin
BdayaIsLoadingMixin
BdayaStreamHandlerMixin
BdayaCombinedRouteController
suitable for routable pages, mixesBdayaCombinedController
RouterListenableMixin
Localization helpers
ReactiveLocalizedFormField
which operates on aFormControl<LocalizedStr>
to support multi-formfield inputs of localization
Usage
Check the /example
folder for a complete example of the architecture we use