Skip to content

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

@junjizhi

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?

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