I'm new to flutter/dart and I'm trying to create a little application using a Clean Architecture design. I read some blogs and several presentations of Uncle Bob's Clean Architecture before starting to code to get the most of it and now it's time to implement it.
I guess my application could be divided in 3 main features :
- authentication
- classes (get access to lessons/quizzes on specific subjects)
- admin (manage user, create lessons etc..)
I started to implement the authentication feature following the clean pattern, that's to say with a domain, data and presentation layer and I guess I did it quite well. It's (almost) fully tested (I'm trying to do some TDD) and seems to work as I wanted.
Now comes the problem. I want to implement the classes feature. I wish it could be independent of the authentication but it's not the case... The classes feature need to get the authenticated user from the authentication feature. I searched a lot on the internet but I can't find how to implement Clean Architecture with multiple features that need to share some data.
So there are my 2 questions:
- How to pass data from a feature to another ?
- How to inject dependency in a feature that need data from another feature ? (I used get_it for the authentication feature and inject all dependencies in the main() method before building the app. Since it did not need any external data it worked well. Now it's seem not possible to do the same for the classes feature since it first needs to get some data from the authentication feature).
Thanks in advance for your answers.