How to create Flutter chat app with PHP Mysql rest api?

4,384

You can create your database with MySQL, and your backend API with php. For the backend you can use SLIM or Laravel or any other php framework. Then in your flutter code you will need to make http requests to this API.

A problem that you can face is Realtime because streams in flutter do not make the data retrieval realtime from a php API. To solve this you will need to add a timer that periodically refreshes the chat. A better solution is to use sockets to make the chat realtime. You can also use firebase cloud messaging for notifications which is free of charge.

This might be useful for you: https://www.youtube.com/watch?v=6vOIk2-WoxQ&list=PL_5DleQzXnX4GRhKef32CiSs2oBfTVxe3

Share:
4,384
Ebadullah amini
Author by

Ebadullah amini

Updated on December 20, 2022

Comments

  • Ebadullah amini
    Ebadullah amini over 1 year

    I want to create a chat app in Flutter but all chat data need to store on my server Mysql via PHP API as backend. (I do not want Firebase Firestore or Realtime database)

    As many people create chat app on the web via the help of JavaScript, jQuery & Ajax but I don't know how I will use this on Flutter.