bvvm 0.0.1+1 copy "bvvm: ^0.0.1+1" to clipboard
bvvm: ^0.0.1+1 copied to clipboard

A Flutter package that aids in developing using the BVVM pattern (BLoC, View, ViewModel).

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 );

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 );

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 );

To aid in getting everything setup, it is recommended to use the BBVMState class in your stateful widgets like:

class _MyPageState extends BVVMState<MyPage> { ... }

This will register the proper dependencies with Flutter and ensure you are working with the right instance of BLoC & ViewModel

0
likes
110
pub points
0%
popularity

Publisher

unverified uploader

A Flutter package that aids in developing using the BVVM pattern (BLoC, View, ViewModel).

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

collection, element_tree_child_locator, event_bus, flutter, get_it, observable_value

More

Packages that depend on bvvm