4

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.

2
  • Are you trying to create flutter app for mobile or web? Commented May 11, 2020 at 13:34
  • for mobile @CrazyLazyCat Commented May 11, 2020 at 13:36

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

the video is not in English
0

Building a chat app with a PHP MySQL backend means you need to create and manage your own database, write custom code to send and retrieve messages, and handle real-time communication, which can be tricky and take a lot of time. On the other hand, you can go with solutions like MirrorFly that gives you a ready-made chat solution with features like real-time messaging, unlimited file sharing, voice/video calls, and live streaming, all without needing to worry about managing the backend or servers. While PHP gives you more control and customization, MirrorFly makes the development process faster, easier, and more secure, helping you launch a full-featured chat app quickly.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.