This is a simple chat app written in Flutter with Firestore backend. It was inspired by this dribbble shot.
It was created during Flutter Warsaw and devWarsztaty workshop #2 on April 13, 2019.
It contains already prepared google-services.json and GoogleService-Info.plist files, but they will stop working soon in the future, so you may need to recreate them in your own Firebase console by following this guide.
This project uses Firebase and Firestore to work.
Please run flutter upgrade
before. The project was developed with Flutter 1.3.8 initially.
Before starting you should have prepared your Firestore database as follows:
- Add collection
rooms
- In
rooms
add new document with auto id and following fields:
name
: stringlastMessage
: mapavatar
: stringfrom
: stringcontent
: stringid
: stringtimestamp
: timestamp
- Initially set all the security rules as public. Remember to turn them off later to protect your account quota.
At this point you have a simple one page app with Firebase and other small details preconfigured like file structure or required packages and plugins.
In this part we're going to write a basic login page login_page.dart
, chat_rooms_page.dart
and initial layout of messages_page.dart
.
In this part we're goting to develop models for storing chat rooms and messages across the app in:
chat_room.dart
chat_rooms_model.dart
message.dart
messages_model.dart
We're going to use Scoped Model to update views after fetching from or uploading data to Firestore.
Thank you all for helping Flutter Warsaw team to organize our second workshop.
See more on Flutter Warsaw Meetup.