Flutter Chat app using MQTT.

Overview

Flutter Chat app using MQTT.

The Broker should install HiveMQ Chat-Extension first.

Screenshots

Login Rooms Chat
A test image, A test image, A test image,
Profile Contact details Media messages
A test image, A test image, A test image,

Features

  • Login
  • Send & receive messages
  • Typing indicator
  • Send Files
  • Persist User, Messages and rooms using local database
  • ChatMarker (In Progress)
  • Invite a user to chat
  • Group Chat
  • Presence
  • File Previews (PDF and images Done)
  • Push Notifications When App is in Background.
Comments
  • I have re-written backend to golang

    I have re-written backend to golang

    Just for anyone also interested in this project, I believe op gets a very impressive implementationon mqtt chatter. But after I tried the default Java backend, it was messy to be honest, So i re-written it into Golang, now

    It looks great, everything works fine. So that mine and share a same client with ops, but with different backend.

    Here is some screen shot of mine:

    image

    image

    The enhancement based on this version, I did:

    • Dark mode switch;
    • Users can change their profiles directly in Client;
    • Send picture support on Linux && Windows;
    • Send picture now can save in local, both PC && phone supported;
    • Fix some backend SQL query problems in ops version.
    • now we support Chinese && Janpaness, input and sending
    opened by jinfagang 5
  • Functions not normal

    Functions not normal

    Finally after fix some bugs in your backend server java code, I got it run now.

    image

    But some problems really bad:

    1). the messages can not sort by time (not distinguish coming msgs or my msgs, it should natrually sort by time, but now , its not;

    1. Can not send Chinese.

    2. Can not send picture.

    opened by jinfagang 5
  • Registering a user

    Registering a user

    Hi WahidNasri,

    I can't find out how to register a user.

    After building the app, here is the terminal output (sorry it seems a bit long)

    $ flutter run ...

    `💪 Running with sound null safety 💪

    An Observatory debugger and profiler on SM G991B is available at: http://127.0.0.1:54479/_RRjKnM55QU=/ The Flutter DevTools debugger and profiler on SM G991B is available at: http://127.0.0.1:54488?uri=http%3A%2F%2F127.0.0.1%3A54479%2F_RRjKnM55QU%3D%2F I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 0 I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 1 I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 0 I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 1 I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 0 I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 1 I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 0 I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 1 D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt D/InputMethodManager(12701): view is not EditText D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity] D/InputMethodManager(12701): getNavigationBarColor() -855310 V/InputMethodManager(12701): Starting input: tba=com.example.flutter_mqtt ic=io.flutter.plugin.editing.InputConnectionAdaptor@22a1f65 mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false D/InputMethodManager(12701): startInputInner - Id : 0 I/InputMethodManager(12701): startInputInner - mService.startInputOrWindowGainedFocus D/InputTransport(12701): Input channel constructed: 'ClientS', fd=116 D/InputTransport(12701): Input channel destroyed: 'ClientS', fd=109 D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity] D/InputMethodManager(12701): getNavigationBarColor() -855310 D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity] D/InputMethodManager(12701): getNavigationBarColor() -855310 V/InputMethodManager(12701): Starting input: tba=com.example.flutter_mqtt ic=io.flutter.plugin.editing.InputConnectionAdaptor@5efb8eb mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false D/InputMethodManager(12701): startInputInner - Id : 0 I/InputMethodManager(12701): startInputInner - mService.startInputOrWindowGainedFocus D/InputTransport(12701): Input channel constructed: 'ClientS', fd=115 D/InputTransport(12701): Input channel destroyed: 'ClientS', fd=116 W/IInputConnectionWrapper(12701): getExtractedText on inactive InputConnection W/IInputConnectionWrapper(12701): getTextBeforeCursor on inactive InputConnection W/IInputConnectionWrapper(12701): getExtractedText on inactive InputConnection W/IInputConnectionWrapper(12701): getTextBeforeCursor on inactive InputConnection W/IInputConnectionWrapper(12701): getExtractedText on inactive InputConnection W/IInputConnectionWrapper(12701): getTextBeforeCursor on inactive InputConnection E/SpannableStringBuilder(12701): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length E/SpannableStringBuilder(12701): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length E/SpannableStringBuilder(12701): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length E/SpannableStringBuilder(12701): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length D/InsetsSourceConsumer(12701): setRequestedVisible: visible=true, type=13, host=com.example.flutter_mqtt/com.example.flutter_mqtt.MainActivity, from=android.view.InsetsSourceConsumer.show:229 android.view.InsetsController.showDirectly:1437 android.view.InsetsController.controlAnimationUnchecked:1110 android.view.InsetsController.applyAnimation:1417 android.view.InsetsController.show:962 android.view.ViewRootImpl$ViewRootHandler.handleMessage:6146 android.os.Handler.dispatchMessage:106 android.os.Looper.loop:246 android.app.ActivityThread.main:8595 java.lang.reflect.Method.invoke:-2 I/ViewRootImpl@ea15fdfMainActivity: MSG_RESIZED_REPORT: frame=(0,0,1080,2400) ci=(0,80,0,944) vi=(0,80,0,944) or=1 I/ViewRootImpl@ea15fdfMainActivity: [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:10957 android.view.ViewRootImpl.access$1200:256 android.view.ViewRootImpl$ViewRootHandler.handleMessage:6101 I/SurfaceControl(12701): nativeRelease nativeObject s[-5476376677826290144] I/SurfaceControl(12701): nativeRelease nativeObject e[-5476376677826290144] I/SurfaceControl(12701): assignNativeObject: nativeObject = 0 Surface(name=null)/@0x167b48a / android.view.SurfaceControl.readFromParcel:1117 android.view.IWindowSession$Stub$Proxy.relayout:1820 android.view.ViewRootImpl.relayoutWindow:9005 android.view.ViewRootImpl.performTraversals:3360 android.view.ViewRootImpl.doTraversal:2618 android.view.ViewRootImpl$TraversalRunnable.run:9971 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995 I/SurfaceControl(12701): nativeRelease nativeObject s[-5476376677826253632] I/SurfaceControl(12701): nativeRelease nativeObject e[-5476376677826253632] I/SurfaceControl(12701): nativeRelease nativeObject s[-5476376677826290032] I/SurfaceControl(12701): nativeRelease nativeObject e[-5476376677826290032] I/SurfaceControl(12701): nativeRelease nativeObject s[-5476376677826249488] I/SurfaceControl(12701): nativeRelease nativeObject e[-5476376677826249488] I/ViewRootImpl@ea15fdfMainActivity: Relayout returned: old=(0,0,1080,2400) new=(0,0,1080,2400) req=(1080,2400)0 dur=16 res=0x1 s={true -5476376672993932736} ch=false fn=37 I/ViewRootImpl@ea15fdfMainActivity: [DP] pd() Asnyc report W/libEGL (12701): EGLNativeWindowType 0xb400006e55f60a50 disconnect failed I/ViewRootImpl@ea15fdfMainActivity: [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$performDraw$1$ViewRootImpl:4668 android.view.-$$Lambda$ViewRootImpl$DJd0VUYJgsebcnSohO6h8zc_ONI.run:6 android.os.Handler.handleCallback:938 I/ViewRootImpl@ea15fdfMainActivity: [DP] rdf() I/SurfaceControl(12701): nativeRelease nativeObject s[-5476376677826287232] I/SurfaceControl(12701): nativeRelease nativeObject e[-5476376677826287232] D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt D/InputMethodManager(12701): view is not EditText D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity] D/InputMethodManager(12701): getNavigationBarColor() -855310 D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt D/InputMethodManager(12701): view is not EditText D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity] D/InputMethodManager(12701): getNavigationBarColor() -855310 D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt D/InputMethodManager(12701): view is not EditText D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity] D/InputMethodManager(12701): getNavigationBarColor() -855310 D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt D/InputMethodManager(12701): view is not EditText D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity] D/InputMethodManager(12701): getNavigationBarColor() -855310 D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt D/InputMethodManager(12701): view is not EditText D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity] D/InputMethodManager(12701): getNavigationBarColor() -855310 I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 0 I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 1 I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 0 I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 1 D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt D/InputMethodManager(12701): view is not EditText D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity] D/InputMethodManager(12701): getNavigationBarColor() -855310 D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity] D/InputMethodManager(12701): getNavigationBarColor() -855310 V/InputMethodManager(12701): Starting input: tba=com.example.flutter_mqtt ic=io.flutter.plugin.editing.InputConnectionAdaptor@2dad660 mNaviBarColor -855310 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false D/InputMethodManager(12701): startInputInner - Id : 0 I/InputMethodManager(12701): startInputInner - mService.startInputOrWindowGainedFocus D/InputTransport(12701): Input channel constructed: 'ClientS', fd=111 D/InputTransport(12701): Input channel destroyed: 'ClientS', fd=115 W/IInputConnectionWrapper(12701): getExtractedText on inactive InputConnection W/IInputConnectionWrapper(12701): getTextBeforeCursor on inactive InputConnection D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt D/InputMethodManager(12701): view is not EditText D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity] D/InputMethodManager(12701): getNavigationBarColor() -855310 D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt D/InputMethodManager(12701): view is not EditText D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity] D/InputMethodManager(12701): getNavigationBarColor() -855310 D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt D/InputMethodManager(12701): view is not EditText D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity] D/InputMethodManager(12701): getNavigationBarColor() -855310 D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt D/InputMethodManager(12701): view is not EditText D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity] D/InputMethodManager(12701): getNavigationBarColor() -855310 D/InputMethodManager(12701): SSI - flag : 0 Pid : 12701 view : com.example.flutter_mqtt D/InputMethodManager(12701): view is not EditText D/InputMethodManager(12701): prepareNavigationBarInfo() DecorView@b50f53d[MainActivity] D/InputMethodManager(12701): getNavigationBarColor() -855310 I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 0 I/ViewRootImpl@ea15fdfMainActivity: ViewPostIme pointer 1 I/flutter (12701): 1-2021-09-23 13:29:13.403568 -- MqttClient::connect - keep alive is enabled with a value of 60 seconds I/flutter (12701): 1-2021-09-23 13:29:13.407537 -- MqttConnectionKeepAlive:: Initialised with a keep alive value of 60 seconds I/flutter (12701): 1-2021-09-23 13:29:13.407654 -- MqttConnectionKeepAlive:: Disconnect on no ping response is disabled I/flutter (12701): 1-2021-09-23 13:29:13.409169 -- MqttConnectionHandlerBase::connect - server 172.16.14.99, port 1883 I/flutter (12701): 1-2021-09-23 13:29:13.411321 -- SynchronousMqttServerConnectionHandler::internalConnect entered I/flutter (12701): 1-2021-09-23 13:29:13.411491 -- SynchronousMqttServerConnectionHandler::internalConnect - initiating connection try 0, auto reconnect in progress false I/flutter (12701): 1-2021-09-23 13:29:13.411738 -- SynchronousMqttServerConnectionHandler::internalConnect - insecure TCP selected I/flutter (12701): 1-2021-09-23 13:29:13.412121 -- SynchronousMqttServerConnectionHandler::internalConnect - calling connect I/flutter (12701): 1-2021-09-23 13:29:13.412846 -- MqttNormalConnection::connect - entered`

    Also I couldn't find the documentation, so I added the dependency into the same directory as this repository and apparently I can run the application, but in order to login, I must register, right?

    opened by staminna 3
  • I have written a Python SDK for this project

    I have written a Python SDK for this project

    Please check my powerful chatbot base on Python SDK:

    image image

    Hi. I have made writen a chatbot based on this client possible!

    And, it was really powerful and convenient to make a bot for anyone.

    I am so happy to share the final version based on flutter-mqtt-chat-client, thanks for original ops wonderful job.

    For future any body interested on this project:

    • You can found python SDK on opensource git url: https://github.com/jinfagang/alfred
    • If you want make a chatbot, you can using my another opensource which will be available soon
    • You can built any command, function based on your bot and MQTT service! For example, using ESP8266 to control your light!
    opened by jinfagang 0
  • [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: FormatException: Unexpected character (at character 2) {id: e74d8c82-626c-419b-b393-ab6bddcb093e, presenceType: Away

    [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: FormatException: Unexpected character (at character 2) {id: e74d8c82-626c-419b-b393-ab6bddcb093e, presenceType: Away

    [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: FormatException: Unexpected character (at character 2)
    {id: e74d8c82-626c-419b-b393-ab6bddcb093e, presenceType: Away, type: Presen...
     ^
    
    #0      _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1405:5)
    #1      _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:935:48)
    #2      _parseJson (dart:convert-patch/convert_patch.dart:40:10)
    #3      JsonDecoder.convert (dart:convert/json.dart:506:36)
    #4      JsonCodec.decode (dart:convert/json.dart:157:41)
    #5      jsonDecode (dart:convert/json.dart:96:10)
    #6      new MqttOnlineReader.<anonymous closure> (package:flutter_mqtt/MqttImpl/MqttOnlineReader.dart:31:41)
    #7      _rootRunUnary (dart:async/zone.dart:1436:47)
    #8      _CustomZone.runUnary (dart:async/zone.dart:1335:19)
    #9      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
    #10     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
    #11     _DelayedData.perform (dart:async/stream_impl.dart:591:14)
    #12     _StreamImplEvents.handleNext (dart:async/stream_impl.dart:706:11)
    #13     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:663:7)
    #14     _rootRun (dart:async/zone.dart:1420:47)
    #15     _CustomZone.run (dart:async/zone.dart:1328:19)
    #16     _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
    #17     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23)
    #18     _rootRun (dart:async/zone.dart:1428:13)
    #19     _CustomZone.run (dart:async/zone.dart:1328:19)
    #20     _CustomZone.runGuarded (dart:async/zone.dart:1236:7)
    #21     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1276:23)
    #22     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
    #23     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
    
    

    when sending image

    opened by jinfagang 0
Owner
null
A powerful Flutter chat UI component library and business logic for Tencent Cloud Chat, creating seamless in-app chat modules for delightful user experiences.

<style> .button-9 { appearance: button; backface-visibility: hidden; background-color: #1d52d9; border-radius: 6px; border-width: 0; box-shadow: rgba(

Tencent Cloud 63 Aug 11, 2023
It is a simple group chat application made with flutter back-end by Firebase. People can chat like a community chat.

flash_chat A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if th

Moideen Rafih P A 4 Aug 7, 2022
Chat-App - A Chat App with flutter and Firebase and Video Calling using WebRTC

chat_app A chat app with flutter and firebase with image message support and vid

Reza Hosseinypour 10 Nov 23, 2022
Chat-application - Build Chat Application using Flutter and Firebase

Build Chat Application using Flutter & Firebase Source Code - Enjoy ! Social Med

Muhammad Irvan 0 Jan 3, 2022
Amir Khan 47 Jan 8, 2023
The most complete Chat UI for flutter highly customizable and helps developing chat UI faster.

⚠️ Dashchat v2 is available in v2 branch ⚠️ You can open issues for the v2 to indicate things we need to implement/fix. Also the API can change until

Fayeed Pawaskar 432 Dec 11, 2022
:rocket: This application using flutter for develop a realtime chat app

Flutter Chat Socket Description: ?? This application using Flutter for develop a realtime chat app How I can run it? ?? Clone this repository ?? Run b

Dao Hong Vinh 17 Dec 31, 2022
A simple chat app UI using flutter SDK project.

Chatty App A simple chat app UI using flutter SDK project. Screenshot Getting Started This project is a starting point for a Flutter application. A fe

Tengku Belmiro 5 Jul 15, 2022
A Chat App Made Using Flutter and Firebase

?? ChatX A Simple Group Chat App Made Using Flutter And Firebase This is a Chat Application where the user can sign-up/log-in either via Email Authent

TRIPARNO CHATTERJEE 6 Aug 26, 2022
Friendly-Chat - Simple text messaging app coded in Dart using the Flutter framework

Friendly Chat A mobile application coded in the Dart programming language using

Vladislav Kostic 3 May 15, 2022
Developed a Group chat application using Flutter and Firebase, where users can register and create groups or join already existing groups and start conversing with each other.

GroupChatApp About Developed a Group chat application using Flutter and Firebase, where users can register and create groups or join already existing

Ahmed Gulab Khan 221 Dec 1, 2022
Andriod online chat application using flutter.

hi i am Bubai das make this andriod online chat application using flutter. requirement A Functional Requirement (FR) is a description of the service t

null 0 Nov 24, 2021
let's build a mobile chat application using flutter and firebase

miichat A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

azzouz abdelhakim 2 Oct 7, 2022
A chat application using Flutter and Firebase.

flutter_chat_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Le Van Thuan My 2 Apr 7, 2022
Simple Chat Application using pure Firebase.

chat_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

null 0 Dec 29, 2021
Chatting-App - A Simple chat app built with Flutter/Dart and Firebase

Chat App By Flutter & Firebase ?? ✨ A Simple chat app built with Flutter/Dart an

Eng.Shahad 1 May 20, 2022
A full-fledged one-to-one chat app developed entirely in Flutter

Enigma Enigma - A minimalist, locked-down one-to-one chat app. Usage Flutter - Get Started Since this is a Firebase dependent project, create a Fireba

Amit Joki 389 Dec 23, 2022
chat app with flutter

Chat App Reader Ui Made with Flutter ?? you can also buy me coffee ?? Requirements ?? Any Operating System (MacOS, Linux, Windows) Any IDE with Flutte

Dami 22 Apr 23, 2022
Flutter chat app

labalaba A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

null 77 Dec 16, 2022