How to connect flutter to backend X?

A question that is often asked in the Flutter community is: “How do I connect my app to backend X?” X is here interchangeable with Spring Boot, Flask, Django, or similar technologies. To understand the answer lets first have a look at how the backend and Flutter app interact.

On the left are all services, connected to the backend. In this case, it is a flutter app, a native app, and a debugging client like Postman, where you can send and analyze HTTP requests. Each client sends an HTTP request to the backend which then responds with an HTTP response. These HTTP requests can be imagined as surfing to the URL of the request via a web browser (in fact, that’s exactly what browsers do).

The backend serves HTTP endpoints. Each endpoint serves a purpose and can be called by the client. In the example above, /post/{id} would be an endpoint that takes the post ID as a parameter. The implementation of the backend determines how much endpoints there are.

To get back to the initial question, you can connect your flutter app to ANY backend, because the technology used in the backend (Java Spring, Python Django, …) is hidden under the HTTP interface which gets called by the app.

Leave a Reply