mirror of
https://github.com/Iconica-Development/flutter_chat.git
synced 2025-05-18 18:33:49 +02:00
feat: update chat example
This commit is contained in:
parent
3003ed5389
commit
6f78ae6518
4 changed files with 12 additions and 8 deletions
|
@ -1,6 +1,8 @@
|
|||
# Flutter Community Chat
|
||||
Flutter Community Chat is a package which gives the possibility to add a (personal or group) chat to your Flutter-application. Default this package adds support for a Firebase back-end. You can add your custom back-end (like a Websocket-API) by extending the `CommunityChatInterface` interface from the `flutter_community_chat_interface` package.
|
||||
|
||||

|
||||
|
||||
## Setup
|
||||
To use this package, add flutter_community_chat as a dependency in your pubspec.yaml file:
|
||||
|
||||
|
|
BIN
example.gif
Normal file
BIN
example.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 267 KiB |
|
@ -43,7 +43,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||
imageUrl: 'https://xsgames.co/randomusers/avatar.php?g=male',
|
||||
),
|
||||
text: 'Met mij gaat het goed, dankje!',
|
||||
timestamp: DateTime.now(),
|
||||
timestamp: DateTime.now().subtract(const Duration(days: 2)),
|
||||
)
|
||||
];
|
||||
|
||||
|
@ -53,6 +53,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||
lastName: 'Sjagerars',
|
||||
imageUrl: 'https://xsgames.co/randomusers/avatar.php?g=female',
|
||||
),
|
||||
lastUsed: DateTime.now(),
|
||||
messages: messages,
|
||||
);
|
||||
|
||||
|
@ -60,14 +61,15 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
|
|||
title: 'Group chat',
|
||||
imageUrl: 'https://xsgames.co/randomusers/avatar.php?g=male',
|
||||
users: [pietUser, janUser],
|
||||
messages: messages);
|
||||
lastUsed: DateTime.now().subtract(const Duration(days: 1)),
|
||||
messages: messages,
|
||||
);
|
||||
|
||||
Stream<List<ChatModel>> get chatStream => (() {
|
||||
late StreamController<List<ChatModel>> controller;
|
||||
controller = StreamController<List<ChatModel>>(
|
||||
onListen: () {
|
||||
controller.add([
|
||||
chat,
|
||||
groupChat,
|
||||
chat,
|
||||
]);
|
||||
|
|
|
@ -218,8 +218,8 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
path: "packages/flutter_community_chat_interface"
|
||||
ref: "feature/group-chats"
|
||||
resolved-ref: cc5c5b6e1cd12c150a0aa7e1b363cc45267009c3
|
||||
ref: "0.3.0"
|
||||
resolved-ref: "3003ed53896c045574ecc64e00c113db3b850e7f"
|
||||
url: "https://github.com/Iconica-Development/flutter_community_chat.git"
|
||||
source: git
|
||||
version: "0.3.0"
|
||||
|
|
Loading…
Reference in a new issue