2

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.

2
  • you can use flutter with your native android.docs.flutter.dev/development/add-to-app/android/project-setup Commented Mar 7, 2022 at 10:36
  • Yeh..I did that for one module..but the query I have is around multiple modules and cross interaction beween different modules and how to build a fresh flutter app with various flutter modules. Commented Mar 7, 2022 at 10:41

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.