You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, I want to express my deep appreciation for your incredible work on Riverpod. I'm a big fan of this library, and it has significantly improved how I structure and manage state in my Flutter projects. Thank you for creating such a powerful and flexible tool!
I'm currently facing a challenge while working on a project with a layered architecture, and I would love to get your insights.
Context:
I have two packages: package_data_layer and package_domain_layer.
In package_data_layer, there's a repository that exposes a Stream. I'm not particularly fond of using async-await for repository interactions, so I expose the stream directly. I also created a provider that listens to this stream, which then returns AsyncValue states. I find this approach convenient for working with streams.
In package_domain_layer, I have another provider that needs to listen to the provider from package_data_layer.
Issue:
The code works perfectly when everything is in a single package. However, I'm unsure how to properly link these providers across different packages. I'm concerned that I might be missing a best practice or doing something fundamentally wrong.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Remi,
First off, I want to express my deep appreciation for your incredible work on Riverpod. I'm a big fan of this library, and it has significantly improved how I structure and manage state in my Flutter projects. Thank you for creating such a powerful and flexible tool!
I'm currently facing a challenge while working on a project with a layered architecture, and I would love to get your insights.
Context:
I have two packages: package_data_layer and package_domain_layer.
In package_data_layer, there's a repository that exposes a Stream. I'm not particularly fond of using async-await for repository interactions, so I expose the stream directly. I also created a provider that listens to this stream, which then returns AsyncValue states. I find this approach convenient for working with streams.
In package_domain_layer, I have another provider that needs to listen to the provider from package_data_layer.
Issue:
The code works perfectly when everything is in a single package. However, I'm unsure how to properly link these providers across different packages. I'm concerned that I might be missing a best practice or doing something fundamentally wrong.
Here’s a simplified version of my setup:
Beta Was this translation helpful? Give feedback.
All reactions