Skip to content

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

Description

@junjizhi

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions