Integrating python with flutter Integrating python with flutter dart dart

Integrating python with flutter


If your app depends on python packages then I would highly recommend using chaquopy package as it's easy to use and supports python packages as well to integrate and use it in your app.


Sounds like you need an API. There's many ways to do this, but since you're using Python, I suggest you try Flask. They have plenty of documentation on their site, https://flask.palletsprojects.com/en/1.1.x/quickstart/#a-minimal-application.

Once you have that API, you'll need to use it. Flutter has a tutorial for that too, https://flutter.dev/docs/cookbook/networking/fetch-data

If your Flutter app is run on the same machine as the Python code, then you won't need an API. You could just output data with python to a file, and read that with Flutter https://flutter.dev/docs/cookbook/persistence/reading-writing-files