flutter_chat/packages/flutter_community_chat/lib/flutter_community_chat.dart

33 lines
1.2 KiB
Dart
Raw Normal View History

2022-11-01 08:33:32 +01:00
// SPDX-FileCopyrightText: 2022 Iconica
//
// SPDX-License-Identifier: BSD-3-Clause
2022-10-14 15:00:22 +02:00
library flutter_community_chat;
import 'package:flutter/material.dart';
2022-11-22 11:41:09 +01:00
import 'package:flutter_community_chat/service/chat_service.dart';
2022-10-14 15:00:22 +02:00
import 'package:flutter_community_chat_interface/flutter_community_chat_interface.dart';
import 'package:flutter_community_chat_view/flutter_community_chat_view.dart';
export 'package:flutter_community_chat_view/flutter_community_chat_view.dart';
2022-11-22 11:41:09 +01:00
export 'package:flutter_community_chat/service/chat_service.dart';
export 'package:flutter_community_chat_interface/flutter_community_chat_interface.dart';
2022-10-14 15:00:22 +02:00
2022-11-22 11:41:09 +01:00
class CommunityChat extends StatelessWidget {
2022-10-14 15:00:22 +02:00
const CommunityChat({
2022-11-22 11:41:09 +01:00
required this.chatService,
2022-10-14 15:00:22 +02:00
super.key,
});
2022-11-22 11:41:09 +01:00
final ChatService chatService;
2022-10-14 15:00:22 +02:00
@override
Widget build(BuildContext context) => ChatScreen(
2022-11-22 11:41:09 +01:00
chats: chatService.dataProvider.getChatsStream(),
onPressStartChat: () => chatService.onPressStartChat(context),
onPressChat: (chat) => chatService.onPressChat(context, chat),
onDeleteChat: (ChatModel chat) => chatService.deleteChat(chat),
options: chatService.options,
translations: chatService.translations(context),
2022-10-14 15:00:22 +02:00
);
}