Build flutter app with different flutter modules

1.7k views Asked by At

I have my native application, which we want to change into flutter. For that, we have decided to build multiple flutter modules and add that to the existing native application. I am not sure whether flutter support building multiple modules in a single native application. Also in the future, as we want to move away from native completely, I didn't find any solution where we can build a fresh flutter application using already developed flutter modules.

1

There are 1 answers

0
sunderee On

It is possible. What you can do is create modules (packages) somewhere in your project, for example, create a directory modules and place them there.

.
├── modules
│   ├── module1
│   ├── module2
│   ├── module3
│   └── module4

To add them to the current project, in your pubspec.yaml, you can do the following:

dependencies:
    # ...
    module1:
        path: ./modules/module1
    # ... etc for other modules

These local modules are called path dependencies.