Actively maintained, community-driven Firebase BaaS for chat applications with an optional chat UI.

Overview

Flyer Chat logo

Flutter Firebase Chat Core

Actively maintained, community-driven Firebase BaaS for chat applications with an optional chat UI.


Pub Build Status CodeFactor


Chat Image


Flyer Chat is a platform for creating in-app chat experiences using Flutter or React Native. This repository contains Firebase BaaS implementation for Flutter. We are also working on our more advanced SaaS and self-hosted solutions.

  • Free, open-source and community-driven. We offer no paid plugins and strive to create an easy-to-use, almost drop-in chat experience for any application. Contributions are more than welcome! Please read our Contributing Guide.

  • Chat UI agnostic. You can choose the chat UI you prefer. But if you don't have one, we provide our own free and open-source Flutter Chat UI, which can be used to create a working chat in minutes.

  • Easy to use. Returns streams of data for messages, rooms and users. Firebase Security Rules control access to the data. Check our documentation for the info.

Getting Started

Requirements

Dart >=2.14.0 and Flutter >=2.0.0, Firebase project.

Read our documentation or see the example project. To run the example project you need to have your own Firebase project and depending on the platform you want to:

  1. Create an iOS app with a bundle ID com.example (only required for the example project, you can use anything for your app) in Firebase console of your project and download generated GoogleService-Info.plist. Put it in the example/ios/Runner folder. You don't need to open Xcode to do it, it will expect this file in this folder.
  2. Create an Android app with package name com.example (only required for the example project, you can use anything for your app) in Firebase console of your project and download generated google-services.json. Put it in the example/android/app folder.
  3. Create a web app in Firebase console of your project. You will see a script that will look like this
 <!-- Firebase Configuration -->
<script>
  // Your web app's Firebase configuration
  var firebaseConfig = {
    apiKey: "...",
    authDomain: "[YOUR_PROJECT].firebaseapp.com",
    projectId: "[YOUR_PROJECT]",
    storageBucket: "[YOUR_PROJECT].appspot.com",
    messagingSenderId: "...",
    appId: "1:...:web:..."
  };
  // Initialize Firebase
  firebase.initializeApp(firebaseConfig);
</script>

Create a firebase-config.js file in the example/web folder and put there only js part like this

var firebaseConfig = {
  apiKey: "...",
  authDomain: "[YOUR_PROJECT].firebaseapp.com",
  projectId: "[YOUR_PROJECT]",
  storageBucket: "[YOUR_PROJECT].appspot.com",
  messagingSenderId: "...",
  appId: "1:...:web:..."
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);

After all of this is done you will need to register a couple of users and the example app will automatically suggest email and password on the register screen, default password is Qawsed1-. To set up Firebase Security Rules so users can see only the data they should see, continue with our documentation.

Contributing

Please read our Contributing Guide before submitting a pull request to the project.

Code of Conduct

Flyer Chat has adopted the Contributor Covenant as its Code of Conduct, and we expect project participants to adhere to it. Please read the full text so that you can understand what actions will and will not be tolerated.

License

Licensed under the Apache License, Version 2.0

Comments
  • Added lastMessage function to examples

    Added lastMessage function to examples

    (Tested, it works :D)

    Changed old cloud functions example to js and a newer (not deprecated environment). Also added cloud functions example for changing a room's lastMessage

    opened by markzakharyan 17
  • flutter_firebase_chat_core function get list of users through FirebaseChatCore.instance.users(); is not returning list of users in android OS version 11 and 10

    flutter_firebase_chat_core function get list of users through FirebaseChatCore.instance.users(); is not returning list of users in android OS version 11 and 10

    General

    What bug do you experience? 🐞

    Provide a clear and concise description of what the bug is.

    How can it be reproduced? πŸ€”

    A few steps to define where does the bug occur. Step 1. ... Step 2. ... etc.

    What behavior is expected? πŸ’‘

    A clear and concise description of what you expected to happen.


    Extras

    Screenshots or videos πŸ“Έ

    If applicable, add screenshots or videos to help explain your problem.

    Code snippets πŸ“

    If applicable, add code samples to help explain your problem.

    // Your snippet here...
    

    Environment info

    Please specify the flutter, flutter_firebase_chat_core versions.

    flutter: ... flutter_firebase_chat_core: ...

    flutter doctor -v output πŸ‘‡


    Platform

    Device (e.g. Android emulator, iOS simulator, Samsung Galaxy S21): ...

    OS version (e.g. iOS 14.5, Android 11): ...


    Additional context

    Add any other context about the problem here.

    bug 
    opened by DikshaCT27 16
  • room.lastMessages is Always null

    room.lastMessages is Always null

    I am streaming rooms using code below FirebaseChatCore.instance.rooms(orderByUpdatedAt: true)

    However it looks like lastMessages is always null room.lastMessages

    I am 100 percent sure that I have last messages on the rooms collection (Which is updated by cloud function)

    question 
    opened by mashegoindustries 15
  • New messages on chat's notifications

    New messages on chat's notifications

    Is your feature request related to a problem?

    In every chat application, there is the need to be informed when a new unreaded message come in a chat, so she/he can be aware he/she must read the new messages.

    What solution would you suggest?

    Related to the fireabase_chat_core, following the events on the stream and having a delivered/unread status, it is possible to warn when a new message comes with a notification.

    Is there any additional solution to that?

    A clear and concise description of any alternative solutions or features you've considered.

    Extras

    Screenshots or videos πŸ“Έ If applicable, add screenshots or videos to help explain your feature.

    Code snippets πŸ“ If applicable, add code samples to help explain your feature.

    // Your snippet here...
    

    Related issues/PRs

    Let us know if this is related to any issue/pull request.

    feature 
    opened by SalahAdDin 8
  • Implement Firebase Realtime Database backend

    Implement Firebase Realtime Database backend

    Would be nice to have an alternative backend to Firestore. Found this sample app for Firebase Realtime Database, perhaps we could use it here https://firebase.google.com/codelabs/firebase-android and the code at https://github.com/firebase/codelab-friendlychat-android

    feature 
    opened by giorgio79 7
  • how to add more characteristic to users

    how to add more characteristic to users

    General

    What bug do you experience? 🐞

    When we come to the rooms list page and one of the users, for instance, has no a profile photo, it gives an error on console:

    ======== Exception caught by image resource service ================================================
    The following ArgumentError was thrown resolving an image codec:
    Invalid argument(s): No host specified in URI file:///
    
    When the exception was thrown, this was the stack: 
    #0      _HttpClient._openUrl (dart:_http/http_impl.dart:2636:9)
    flyerhq/flutter_chat_ui#1      _HttpClient.getUrl (dart:_http/http_impl.dart:2565:48)
    flyerhq/flutter_chat_ui#2      NetworkImage._loadAsync (package:flutter/src/painting/_network_image_io.dart:89:59)
    flyerhq/flutter_chat_ui#3      NetworkImage.load (package:flutter/src/painting/_network_image_io.dart:50:14)
    flyerhq/flutter_chat_ui#4      ImageProvider.resolveStreamForKey.<anonymous closure> (package:flutter/src/painting/image_provider.dart:503:13)
    ...
    Image provider: NetworkImage("", scale: 1.0)
    Image key: NetworkImage("", scale: 1.0)
    ====================================================================================================
    

    How can it be reproduced? πŸ€”

    A few steps to define where does the bug occur. Step 1. Add a new user without any profile photo. Step 2. Go to the Rooms Page. Step 3. Look at console.

    What behavior is expected? πŸ’‘

    As it happens in the Chat page, if there is no a profile photo, just put the user's name initial letter.


    Extras

    Screenshots or videos πŸ“Έ

    image

    Code snippets πŸ“

    If applicable, add code samples to help explain your problem.

    // Your snippet here...
    

    Environment info

    Please specify the flutter, flutter-chat-ui versions.

      cloud_firestore: ^2.3.0
      file_picker: ^3.0.3
      firebase_auth: ^1.4.1
      firebase_core: ^1.3.0
      firebase_storage: ^8.1.3
    flutter: 2.2.2
    
      flutter_chat_ui: ^1.1.5
      flutter_firebase_chat_core: ^1.1.0
      image_picker: ^0.8.1+3
    

    flutter doctor -v output πŸ‘‡

    ❯ flutter doctor -v
    [βœ“] Flutter (Channel stable, 2.2.2, on Linux, locale en_US.UTF-8)
        β€’ Flutter version 2.2.2 at /opt/flutter
        β€’ Framework revision d79295af24 (3 weeks ago), 2021-06-11 08:56:01 -0700
        β€’ Engine revision 91c9fc8fe0
        β€’ Dart version 2.13.3
    
    [βœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        β€’ Android SDK at /home/luisalaguna/Android/Sdk
        β€’ Platform android-30, build-tools 30.0.3
        β€’ Java binary at: /opt/android-studio/jre/bin/java
        β€’ Java version OpenJDK Runtime Environment (build 11.0.8+0-b944-P17168821)
        β€’ All Android licenses accepted.
    
    [βœ“] Chrome - develop for the web
        β€’ Chrome at google-chrome
    
    [βœ“] Android Studio (version 4.2)
        β€’ Android Studio at /opt/android-studio
        β€’ Flutter plugin version 57.0.2
        β€’ Dart plugin version 202.8531
        β€’ Java version OpenJDK Runtime Environment (build 11.0.8+0-b944-P17168821)
    
    [βœ“] VS Code (version 1.57.1)
        β€’ VS Code at /usr/share/code
        β€’ Flutter extension version 3.23.0
    
    [βœ“] Connected device (2 available)
        β€’ Xiaomi Redmi Note 7 (mobile) β€’ 192.168.56.101:5555 β€’ android-x86    β€’ Android 10 (API 29)
        β€’ Chrome (web)                 β€’ chrome              β€’ web-javascript β€’ Google Chrome 91.0.4472.114
    
    β€’ No issues found!
    
    

    Platform

    Device (e.g. Android emulator, iOS simulator, Samsung Galaxy S21): ...

    OS version (e.g. iOS 14.5, Android 11): ...


    Additional context

    Add any other context about the problem here.

    opened by SalahAdDin 7
  • Return latest message from room

    Return latest message from room

    Hi everyone!

    I want to be able to show the latest message (constantly updating, probably with StreamBuilder) on the Groups page.

    Is there a way to return just the latest message from a room?

    Thanks, Mark

    question 
    opened by markzakharyan 7
  • Is it possible to edit firebase_chat_core.dart?

    Is it possible to edit firebase_chat_core.dart?

    Is it possible to edit the firebase_chat_core.dart-file? I specifically need to add an extra where-clause to this stream

    Stream<List<types.Room>> rooms({bool orderByUpdatedAt = false}) {
        final fu = firebaseUser;
    
        if (fu == null) return const Stream.empty();
    
        final collection = orderByUpdatedAt
            ? getFirebaseFirestore()
                .collection(config.roomsCollectionName)
                .where('userIds', arrayContains: fu.uid)
                .orderBy('updatedAt', descending: true)
            : getFirebaseFirestore()
                .collection(config.roomsCollectionName)
                .where('userIds', arrayContains: fu.uid);
    
        return collection.snapshots().asyncMap(
              (query) => processRoomsQuery(
                fu,
                getFirebaseFirestore(),
                query,
                config.usersCollectionName,
              ),
            );
    
    question 
    opened by jeffmayn 6
  • Isuue with messages stram

    Isuue with messages stram

    Hi! I need a clarification. Stream<List<types.Message>> messages(types.Room room) {

    It always returns all the messages from the room, which means that parsing all over the messages occurs on each new message, right? Don't you think it's time consuming? Should the stream return only the updated document? What do you think?

    question 
    opened by itaishalom 6
  • windows support with firebase_core_desktop

    windows support with firebase_core_desktop

    the Flutter team has announced that Flutter on desktop platforms moved to the stable channel, which includes Linux and MacOS. Windows was announced a couple of months back.

    i have folllowed this intructions but without success, https://invertase.io/blog/announcing-flutterfire-desktop-auth-stable

    is there any plans to support firebase_core_desktop for windows applications?

    feature 
    opened by somebay 1
  • Embed in another App

    Embed in another App

    I have read through the docs, and example code. The example code seems like a collection of independent Scaffolds, like Rooms, ChatPage, LoginPage. Scaffolds don't seem like the best Widget type to plug it into another App, because the Parent app probably already has a scaffold, with AppBar. I think that it is not recommended to put Scaffolds inside of Scaffolds. I think there are some other Issues with putting the example code into another App, like the Routing.

    Would it make sense to make a single Container, without an AppBar that has all of the parts from the Example code? Maybe this code could be considered a second example? This might make it easier for people to add this to their app. And it might be nice to have an example of how to put the chat into your app.

    Would this be useful? Is there some reason that it should be done differently?

    I'd be happy to write this code.

    question 
    opened by gwbischof 2
  • Can anyone help with a rules of storage for the project firebase_chat_core instead of just using the default rules?

    Can anyone help with a rules of storage for the project firebase_chat_core instead of just using the default rules?

    I ran into this problem when I ran the code for example : "β€œ[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: [firebase_storage/unauthorized] User is not authorized to perform the desired action.”"

    question 
    opened by chinecc 3
  • Way too many reads

    Way too many reads

    Hey there!

    I implemented the chat in my app with cloud functions for updating the message status etc. Now the problem I have that before cloud functions, sending a message and opening a chat was already like 50 reads. But now it is 150 reads per single message. Any way to improve that?

    question 
    opened by Syltas 2
Releases(v1.6.4)
Owner
Flyer Chat
Platform for creating in-app chat experiences using React Native or Flutter.
Flyer Chat
An opinionated, community-driven set of lint rules for Dart and Flutter projects. Like pedantic but stricter

Lint for Dart/Flutter lint is a hand-picked, open-source, community-driven collection of lint rules for Dart and Flutter projects. The set of rules fo

Pascal Welsch 257 Jan 3, 2023
A flutter plugin for improved row and column widgets with added spacing and optional interleaved dividers

flutter_series A flutter plugin for improved row and column widgets with added s

null 0 Nov 1, 2021
A cross-platform Flutter widget for displaying websites. Optional navigation buttons.

Overview Gives you a cross-platform Flutter widget for displaying websites and other web content. Licensed under the Apache License 2.0. Links Github

Dint 11 Oct 23, 2022
A collection of useful packages maintained by the Flutter team

Flutter Packages This repo is a companion repo to the main flutter repo. It contains the source code for Flutter's first-party packages (i.e., package

Flutter 2.3k Dec 30, 2022
Cross-platform flutter plugin for reading and writing NFC tags. Not maintained anymore - not looking for new maintainer, fork instead.

nfc_in_flutter NFC in Flutter is a plugin for reading and writing NFC tags in Flutter. It works on both Android and iOS with a simple stream interface

Andi Semler 113 Sep 28, 2022
Flutter-ffmpeg - FFmpeg plugin for Flutter. Not maintained anymore. Superseded by FFmpegKit.

flutter_ffmpeg FFmpeg plugin for Flutter. Supports iOS and Android. Not maintained anymore, superseded by FFmpegKit. See FlutterFFmpeg to FFmpegKit Mi

Taner Şener 635 Dec 22, 2022
Dumbo - A collection of all dumb stuff at one place, this repo is to be maintained for people who just simply are taking break from huge stuff and practicing something.

dumbo 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 is

Krish Bhanushali 1 Jan 3, 2022
Domain-Driven Design + Firebase Flutter Course

Domain-Driven Design + Firebase Flutter Course The whole accompanying tutorial series is available at ?? this link ?? . Find more tutorials on resocod

Reso Coder 413 Dec 31, 2022
COVID-19 application made with Flutter, following Test Driven Development (TDD) and Clean Architecture along with Internationalization with JSON.

Covid App COVID-19 application made with Flutter, following Test Driven Development (TDD) and Clean Architecture along with Internationalization with

Sandip Pramanik 4 Aug 4, 2022
A mobile application that allows you to search and fetch recipes using Flutter, TheMealDB and Domain Driven Design

recipe_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 th

Johnny Nguyen 0 Dec 4, 2021
Crypto Loss Gain Calculator App build with Flutter. It developed with DDD (Domain Driven Design) principles.

Crypto Loss Gain Calculator Crypto Loss Gain Calculator App build with Flutter. It developed with DDD (Domain Driven Design) principles. Domain-Driven

Selim Üstel 9 Dec 27, 2022
Flutter_ddd - Experimental Flutter project with Domain-Driven Design

flutter_ddd Notes app sample in Dart / Flutter with DDD. This is an outcome of my attempt to understand Domain-Driven Design and consider how I can in

Kabo 90 Dec 18, 2022
Flutter starter project - boilerPlate for Clean Architecture with Domain-Driven-Design with commonly used dependencies

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

MJ Montes 0 Jan 2, 2022
This project follows the Reso Coder course for flutter test-driven-development with clean architecture and BloC state management for a random trivia simple app.

This project follows the Reso Coder course for flutter test-driven-development with clean architecture and BloC state management for a random trivia simple app.

Tomas B Sarmiento Abella 1 Jan 5, 2022
Flutter Architecture inspired by Domain Driven Design, Onion and Clean Architecture

Inspiring Domain Driven Design Flutter Architecture Please take a look at my slides to learn more Strategic Domain Driven Design For Improving Flutter

Majid Hajian 324 Dec 25, 2022
Multi Translator build with Flutter, It developed with DDD (Domain Driven Design) principles.

Multi Translator App An app utilizes to translate any text to multiple languages. Features Localization Multiple Translation Single Translation Deep L

Selim Üstel 7 Dec 27, 2022
flutter chat app with firebase , provider and api with all chat app functions

Full Chat Flutter App In this app we use FireBase Services(firestore - storage - auth - cloud messageing ) Dio for api setiing such as sending remote

Ahmed EL Bagory 35 Dec 14, 2022
Flutter Community Plus Plugins

Flutter Community Plus Plugins Plus plugins PlusPlugins is a set of Flutter plugins that is developed based on existing Flutter plugins with extra fun

Flutter Community 1.1k Jan 3, 2023
Flutter guide + SDK. Check Community repository for common information.

freeRASP for Flutter freeRASP for Flutter is a part of security SDK for the app shielding and security monitoring. Learn more about provided features

Talsec 63 Dec 26, 2022