Flutter/Dart: Communication between features in Clean Architecure Flutter/Dart: Communication between features in Clean Architecure dart dart

Flutter/Dart: Communication between features in Clean Architecure


Along with your 3 features you should add another called core and inside that folder you can add stuffs that need to be shared. It worked for me . Good luck


One option is if you instantiate classes after the user has already logged in, you can pass that data in as a constructor parameter.

More generally, Provider is probably the best dependency injection tool for flutter. If you "provide" the authentication class to the widget tree for the rest of the app, you can say at any point below it, Provider.of(context) to access it and any public field it has.


Hope you're still working on Flutter projects after that long time.

I've been fiddling around with Uncle Bob's Clean architecture, and I managed to implement it in Flutter few months ago.

It's perfect, it separates your code into components (modules if you're coming from a native Android development environment) and isolates your data sources, so if you want to change the way you make API requests for example, you'll only need to change the remote data source part in your app, and all your application should work as expected.

I have made a test app using Clean Architecture I just uploaded on github and added a humble readme that describes the basic architecture and components of the app, I'll work on written articles describing the code very soon.

For now you can access the repo from here