bvvm

Creator: coderz1093

Last updated:

0 purchases

bvvm Image
bvvm Images

Languages

Categories

Add to Cart

Description:

bvvm

This package is a starting point for the BVVM pattern.
WIP, not production ready! #
This pattern is very similar to MVVM; however, the BLoC (as the name implies) will handle all
of the business logic.
Through the use of the BVVMProvider, the bloc and view model are provided to the widget.
The constructor of the BVVMProvider handles building the bloc and view model.
The view has access to the bloc & view model via the use of the .of getter, like:
Bloc.of( context );
ViewModel.of( context );
copied to clipboard
Similar to Provider, do not unsafely call the .of lookups in initState or dispose unless you pass listen: false, like:
Bloc.of( context, listen: false );
copied to clipboard
Both BLoCs and View Models can be located in children elements by passing searchDown:true, though this is not recommended in most cases:
Bloc.of( context, listen: false, searchDown:true );
copied to clipboard
To aid in getting everything setup, it is recommended to use the BBVMState class in your stateful widgets like:
class _MyPageState extends BVVMState<MyPage> { ... }
copied to clipboard
This will register the proper dependencies with Flutter and ensure you are working with the right instance of BLoC & ViewModel

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.