Home > Net >  A real-time chat with admin in flutter
A real-time chat with admin in flutter

Time:09-26

commerce app but I need to create a chat just between every user and admin like for problems and etc so anyone has an idea on how it can be done

CodePudding user response:

I think this is a really general question, but I will share my little knowledge about the matter. Well apart of implementing your own solution, with your own backend and/or websockets, you can also use Firebase to achieve it.

There are some services like getStream that provide some good packages, and all the main functionalities required from a chat, and also UI widgets for it. Of course, is not free.

CodePudding user response:

I've been using AWS services for something similar. The quickest way around it is to use AWS Amplify (think of it as AWS's Firebase).

Here's an article describing how you can build a chat application with Amplify: https://aws.amazon.com/blogs/mobile/building-a-serverless-real-time-chat-application-with-aws-appsync/. Note that this article is from 2018, and it mentions AWS Mobile - which was replaced by AWS Amplify.

The example is for React, but you can easily build your Flutter front end for it. I'd recommend for now using this package, since it supports all the platforms(Android, iOS, Web): https://pub.dev/packages/amazon_cognito_identity_dart_2

If you need only Android and iOS at the moment (and you can wait for the web support), you can also try the official AWS Amplify Flutter: https://pub.dev/packages/amplify_flutter

In any case - you will need some sort of web socket based solution. GraphQL is I think the right way to go (AWS Amplify uses service called AWS Appsync - which is just their implementation of GraphQL).

  • Related