Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's another way mechanism to pass blocs down the tree? #10

Open
junjizhi opened this issue Nov 15, 2018 · 0 comments
Open

What's another way mechanism to pass blocs down the tree? #10

junjizhi opened this issue Nov 15, 2018 · 0 comments

Comments

@junjizhi
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant