Reputation: 39
I'm required to refactor the flutter project code base to extract a single feature from a monolith app into a reusable module that can then be used as something like a library package. What I have done so far is wrapping the presentation and put them in separate flutter package inside a package/
folder at the main project root and add each module as app dependency.
The problem is with the data flow and business logic. In the current project structure, it utilizes dependency injection (or service locator I'm not sure what to call it, but what is used is get_it
package) to handle network calling instance (Dio
and retrofit
) and other usecases.
From my understanding, it's like changing from horizontal layering to vertical architecture. I have read this question but I still need more clarification and advise.
So my question is, to make project with structure like in the right side of the diagram, is it possible to make module network
a separate module and still be able to share data like network session for different modules that depend on it, if yes, what are the solution?
Upvotes: 0
Views: 75