Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Modularization in Flutter to separate each application feature

On Android native to separate each application feature, structured the project, implementing architecture component and to make it easier to work in a team you can use modularization, so each person can focus on their respective work by focusing only on the module. If I want to make a flutter application with examples of 3 application features (login, register, profile) and want to implement modularization for each feature to make it easier to work as a team. How do you implement the modular? Are there references to its best practices for modularizing Flutter? Because if on Android Native there are already many related articles while I check for Flutter it hasn't found it yet.

like image 907
R Rifa Fauzi Komara Avatar asked Jun 17 '19 09:06

R Rifa Fauzi Komara


People also ask

What is modular flutter?

In short: Modular is a solution to modularize the route and dependency injection system, making each scope have its own routes and injections independent of any other factor in the structure. We create objects to group the Routes and Injections and call them Modules.

How do you make a flutter module?

Using the File > New > New Module… menu in Android Studio in your existing Android project, you can either create a new Flutter module to integrate, or select an existing Flutter module that was created previously. If you create a new module, you can use a wizard to select the module name, location, and so on.


1 Answers

Create each feature as a package(library) and add it whenever you want to the main app. For example in my app I use main.dart as a navigator manager and each screen is in different packages.

And this is an example of implementing it: https://github.com/rrifafauzikomara/flutter_modularization

like image 182
LeTadas Avatar answered Sep 24 '22 05:09

LeTadas