Home > front end >  How to build Flutter project with 2 apps?
How to build Flutter project with 2 apps?

Time:01-24

I have 2 Flutter apps - one for user and one for seller.

Right now there is "Seller" button on User app which redirects user to Seller app on Google play/Apple Store if Seller app is not installed, if it's installed, it opens up Seller app I want that button to open my Seller app directly, without user having to install it seperately.

Is it possible for me to integrate Seller app inside of User app? So there is only one apk file, main app that opens up would be User app - and clicking on button "Seller" it would open up second screen (Seller app)

Thanks a lot!

I don't know what possible options are there to merge 2 Flutter apps in one project..

CodePudding user response:

Not sure about it. A solution could be integrating the Seller project as a package inside the User project, but this will require some work to do. It surely isn't plug and play. Having the second project as a package will let you call the code inside and navigate to the seller pages from the main one. Just create a package in the User project and move the code from Seller project inside it. For sure you will need to make some changes, dependencies probably, if you have permissions inside the manifest and stuff like that. Give it a try.

CodePudding user response:

Use a combination of flavor and target to build and publish different versions of a single code base.

flutter <command> --flavor user --target lib/main_user.dart

See Creating flavors for Flutter for details.

  • Related