JaredKarl
JaredKarl

Reputation: 87

How can I connect my Flutter app to local sql server database using API?

Am working on a flutter app that is required to do CRUD functions from sql server. I have researched and found that I can use REST API or webservice for the same. How can I implement this?

Upvotes: 3

Views: 5224

Answers (1)

Gazihan Alankus
Gazihan Alankus

Reputation: 12004

Step 1: choose a backend language/framework that will let you create a REST API. Laravel is one. If you want everything in Dart, Aqueduct I hear is a good choice.

EDIT/NOTE: Aqueduct sunset news here: https://stablekernel.com/article/announcing-the-sunsetting-of-aqueduct-our-open-source-server-side-framework-in-googles-dart/

Step 2: Make that backend do the things that need to be done with the database. Make sure you handle security/authentication. Test it with something like Postman. Manually be able to use it just like the app would use it, e.g., "making this request adds a post".

Step 3: Now develop a Flutter app that connects to this backend with a Dart package such as dio, http, etc. More info here: https://flutter.dev/docs/cookbook#networking

Upvotes: 3

Related Questions