Building a Flutter Chat Application with Stream: Introduction (Part 1)
Tags: mobiledevelopment, flutter, stream, chatapplication
Published: 2020-10-20 13:08:40

![](https://cdn-images-1.medium.com/max/2000/1*Hw0DRh6aJvQALyyIM7v0zg.png)

This article is part of a series on building a fully functional Flutter app with Stream. All other parts, as well as the finished code, can be found below.

[Part 2: Configuration](https://medium.com/flutter-community/building-a-flutter-chat-application-with-stream-configuration-part-2-de92959ce7)

[Part 3: Building the App](https://medium.com/flutter-community/building-a-flutter-chat-application-with-stream-building-the-app-part-3-f18f9c810ba8)

[SpikeChat Github Project](https://github.com/ashtonjonesdev/spike_chat)

## Introduction

I discovered [Stream’s chat API](https://getstream.io/chat/get_started/) and challenged myself to build a fully functional Flutter messaging app with it.

I decided to build [SpikeChat](https://github.com/ashtonjonesdev/spike_chat), a group chat application for me and my friends to plan times to play [Spikeball](https://www.youtube.com/watch?v=xngJzsSbiI8&t=89s).

![](https://cdn-images-1.medium.com/max/2000/1*fHFF3266NItKnAgyFAd7yQ.gif)

## Experience

Stream made it effortless to build a messaging application with Flutter! They have their own Flutter widgets that you use to build the chat features. At first, I thought I would have to build my own database (i.e. Cloud Firestore) to keep the chat in sync on multiple devices. But Stream’s SDK already has local persistent storage AND cloud storage, which means you are not required to implement a database layer.

However, the Flutter documentation is a bit lacking, so I needed to do some work to figure out how to authorize a client with their API. In this series, I’ll explain everything you will need to know to build a fully functional Flutter chat app with Stream.

## SpikeChat Overview

![SpikeChat logo](https://cdn-images-1.medium.com/max/2000/1*oghybRyh9gvwtJq_xrgo6g.png)

A fully functional chat application built with Flutter and Stream!

I wanted to keep the messaging app simple, so I build the application with one channel (chat room) called “Spikeball”

![](https://cdn-images-1.medium.com/max/2000/1*fUQ7qY8M20ONNAK00CmdAg.jpeg)

The chat contains the following features, which come by default with Stream’s SDK:

* ✅ Join the chat room

* ✅ Send text, images, audio, and video in the chat

* ✅ React to messages (i.e. *heart react*) and see the reaction count

* ✅ See when the chat was last active

However, there is quite a bit of configuration in order to get everything to work on both iOS and Android, which I will cover in part 2.

The app requires a passcode in order to enter the chat. I did this as simple a way to implement a private chat only my friends and I can join, without over-engineering the application. The user will not be able to get past this first screen if they do not have the passcode. For the intents of this application, it is sufficient.

![](https://cdn-images-1.medium.com/max/2000/1*1O7HRzxBtQvvhf6bD6R5rA.jpeg)

After entering the correct passcode, my friend gets to choose a username. I use the username to authenticate him/her with the Stream client and create a user for the channel with that username.

![](https://cdn-images-1.medium.com/max/2000/1*LoD1DLz7YXQEv8d-OxFocg.jpeg)

After that’s done, they are logged into the application and brought to the Spikeball chat screen. The chat screen is built using Stream’s Flutter chat widgets. Here, my friends and I can send messages, photos, videos, and audio. We can see when the chat was last active, who sent messages, and react to messages, all in real time.

![](https://cdn-images-1.medium.com/max/2000/1*_INUfO1l1yBm6iZXsKlMfA.jpeg)

## Up Next:

In part 2, I’ll explain how to configure the Stream client and other parts of the project.

If you want to follow along, here is the SpikeChat project:
(https://github.com/ashtonjonesdev/spike_chat)

## Resources:

* [SpikeChat Github project](https://github.com/ashtonjonesdev/spike_chat)

* [Stream website](https://getstream.io/)

* [Spikeball](https://www.youtube.com/watch?v=xngJzsSbiI8&t=89s)

Hi, I’m Ash 👋🏼 Let’s connect!

🌐 [ashtonjones.dev](https://ashtonjones.dev/#/)|👥 **@TJgrapes**|✉️ [ashtonjonesdev@gmail.com](mailto:ashtonjonesdev@gmail.com)

👨‍💻 Google Certified Android Engineer |
✍ Writer |
🧘‍♂️ Stoic && Meditator

📱 Need an app built? Contact me [here](mailto:ashtonjones.dev?subject=Hi%20Ashton!).

![](https://cdn-images-1.medium.com/max/2000/1*8D0WQH0Y7-hCiy_AxI-Xnw.png)

[https://www.twitter.com/FlutterComm](https://www.twitter.com/FlutterComm)