Is there a way to easily (and officialy?) integrate python, and more specifically matplotlib, with flutter?

You can use Flask as a wrapper for the Python functions and return the data in JSON format.

You can then consume the JSON data in Flutter by invoking the Flask endpoints (that in turn invoke Python functions) and present the data in the Flutter UI.

There are many articles on how to invoke HTTP services through Flutter and how to consume JSON data returned from said services into a Flutter Object.

Note: This will require a bit of set-up work and will require many more elements for production quality code, e.g., API Gateway, but for testing/learning purposes you can skip that and talk directly to the services you set-up in Flask.


As answered you can use Flask as a local webserver and retrieve data from python application.

But, if you need better speed and also need to send multiple responses(like progress) from python application to flutter. I would prefer using WebSocket. You can create a local WebSocket server, and connect flutter and python in a faster way.

NOTE: WebSocket are not recommended when you only need responses for specific requests.