In your bloc_complex example, you force the bloc provider to form a tree, even though they may not be...
Widget build(BuildContext context) {
// Here we're providing the catalog component ...
return CatalogProvider(
catalog: catalog,
// ... and the cart component via InheritedWidget like so.
// But BLoC works with any other mechanism, including passing
// down the widget tree.
child: CartProvider(
//...
I understand it's implemented this way because we have to make provider as an ancestor of the children widget. What's an alternative implementation?
In your bloc_complex example, you force the bloc provider to form a tree, even though they may not be...
I understand it's implemented this way because we have to make provider as an ancestor of the children widget. What's an alternative implementation?