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

3,171

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

Share:
3,171
JaredKarl
Author by

JaredKarl

Full-stack Developer, Specializing in Flutter, C#, Javascript, PHP, Laravel Framework

Updated on December 15, 2022

Comments

  • JaredKarl
    JaredKarl over 1 year

    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?

    • Vladyslav Matviienko
      Vladyslav Matviienko over 4 years
      How can I implement this is too broad. Implement the API and use it basically.
  • JaredKarl
    JaredKarl over 4 years
    Thanks, @Gazihan Alankus for your response. I have experience in laravel though I don't know how to link the laravel REST API with the flutter.