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 uniqueloggerBdayaLifeCycleMixin: provides life cycle management for controllers usingbeforeRender: same asinitStatefor stateful widgetsafterRender: gets called after a single frame has been rendered, which is useful for accessing states inGlobalKeysonDispose: same asdisposefor stateful widgets
BdayaIsLoadingMixin: exposes reactiveisLoadingBdayaStreamHandlerMixin: useful for managingStreamandListenablesubscriptions
Hooks using flutter_hooks
useViewController: registers alazySingletoncontroller, and if it usesBdayaLifeCycleMixin, fires the related events
Routing helpers using go_router
RouterListenableMixinlistens toGoRouterfor changes to the current route, and notifies the controller about them
Combined controllers for all of the above
BdayaCombinedControllersuitable for any widget, mixesBdayaLoggableMixinBdayaLifeCycleMixinBdayaIsLoadingMixinBdayaStreamHandlerMixin
BdayaCombinedRouteControllersuitable for routable pages, mixesBdayaCombinedControllerRouterListenableMixin
Localization helpers
ReactiveLocalizedFormFieldwhich 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
