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