Fast and flexibile chat package with full features for easy app development. Actively maintained, community-driven chat UI implementation
Features
- Fast Messaging: The UI updates instantly as soon as it receives a new data. The developing sees to how the application stores the messages and it passes the same messages to the ChatFlow component for either private chats or group chats.
- Customizable UI: Easily customizable chat themes, use builders to create more customized UI and layouts to match your app’s design.
- User Management: Support for user authentication and profile management.
- Media Sharing: Send and receive images, videos, and other media files.
- Group Chats: Create and manage group conversations effortlessly.
- Generic Media Type: Aside from the default message types which include Text, Image, Info, Audio, Video, PDF, Doc and File, there's a Custom type for you to extend and do more just in case the already available types aren't enough which we believe should be enough for most use cases.
- Typing User: Listen to user typing events and do what you want such as notifying other users in the chat about that event.
- Media Preview: By default, chatflow automatically shows a image previews when a user taps on an image message.
See image above
- Select Message: A user can select message(s) in the chat. You get the list of selected message(s) and do what you want by providing a callback.
See API in Documentation
- Message Reply: Messages can be replied to easily. This makes your app more intuitive, modern and engaging.
Etc.
Getting started
To get started with flutter_chatflow, check out the documentation for installation instructions, usage guides, and examples.
Installation
Easiest way is to run the flutter pub add flutter_chatflow
Or Add flutter_chatflow to your pubspec.yaml:
dependencies:
flutter_chatflow: ^0.0.5
Check for current version number as newer version might be available.
Then run flutter pub get
to install the package.
Usage
Here is a basic example to get you started:
import 'package:flutter_chatflow/chatflow.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: ChatScreen(),
);
}
}
class ChatScreen extends StatelessWidget {
List<Message> _messages = [];
ChatUser author = ChatUser({
/// It should be unique and persistent for each user
userID: 'randomID'
})
void _addMessage(Message message) {
/// Handle sending message to server
///Sending to local collection below [OPTIONAL if sent to server and listened correctly]
setState((){
_messages.insert(0, message);
});
}
void _handleSendPressed(String message) {
int createdAt = DateTime.now().millisecondsSinceEpoch;
final textMessage = TextMessage(
author: author,
createdAt: createdAt,
text: message,
status: DeliveryStatus.sending
);
_addMessage(textMessage);
}
void _handleOnAttachmentPressed() async {
/// logic for adding image to chat.
/// You could use a dialog to choose between different media types
/// And rename the function accordingly
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Chat')),
body: ChatFlow(
messages: _messages,
chatUser: author,
onSendPressed: _handleSendPressed,
onAttachmentPressed: _handleOnAttachmentPressed
),
);
}
}
Additional information
For support kindly send a mail to Engr. Isaiah Pius
Contributing
We welcome contributions! Please see our contributing guidelines for more information.
License
flutter_chatflow is released under the BSD license.
Libraries
- chatflow
- models
- notifier
- utils/type_defs
- utils/types
- utils/utils
- widgets/adapt_container_height_to_child_max_height
- widgets/audio/audio_message
- widgets/audio/audio_widget
- widgets/chat_avatar
- widgets/chat_bubble
- widgets/chat_input
- widgets/computed_widget
- widgets/image/image_carousel
- widgets/image/image_message
- widgets/image/image_swipe
- widgets/image/image_upload_preview_with_text_input
- widgets/image/image_widget
- widgets/media_selection_with_text
- widgets/replied_message_widget
- widgets/video/video_message
- widgets/video/video_widget