chatverse 0.0.2
chatverse: ^0.0.2 copied to clipboard
A comprehensive Flutter chat library with Firebase integration, featuring advanced UI, group chat support, and real-time messaging capabilities.
ChatVerse π #
A powerful and customizable Flutter chat library with Firebase integration, featuring a beautiful UI, group chat support, and real-time messaging capabilities.
Features π #
- π₯ Firebase Integration: Built-in support for Firebase Authentication and Cloud Firestore
- π¬ Real-time Messaging: Instant message delivery and updates
- π₯ Group Chat Support: Create and manage group conversations
- π± Modern UI: Beautiful and customizable chat interface
- πΈ Media Support: Send images, videos, and files
- π Message Search: Search through chat history
- π€ User Profiles: Customizable user profiles with avatars
- β‘ Performance Optimized: Efficient message loading and caching
- π¨ Themes: Support for light and dark themes
- π Cross-Platform: Works on iOS, Android, Web, and Desktop
Getting Started π #
Prerequisites #
- Set up Firebase in your Flutter project
- Add the required Firebase dependencies
- Initialize Firebase in your app
Installation #
Add ChatVerse to your pubspec.yaml
:
dependencies:
chatverse: ^0.0.1
Basic Usage #
- Initialize ChatVerse
import 'package:chatverse/chatverse.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}
- Set up the Chat Provider
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MultiProvider(
providers: [
ChangeNotifierProvider(
create: (_) => ChatController(userId: 'current_user_id'),
),
],
child: MaterialApp(
// Your app configuration
),
);
}
}
- Display the Chat Screen
class ChatScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: ChatView(
roomId: 'room_id',
currentUserId: 'current_user_id',
),
);
}
}
Advanced Features π₯ #
Group Chat Management #
// Create a new group
final group = await chatController.createRoom(
name: 'Group Name',
memberIds: ['user1', 'user2', 'user3'],
type: ChatRoomType.group,
adminIds: ['user1'],
);
// Add members to group
await chatController.addMembers(['user4', 'user5']);
// Remove members from group
await chatController.removeMembers(['user2']);
Media Messages #
// Send image message
await chatController.sendMessage(
content: 'image_url',
type: MessageType.image,
);
// Send file message
await chatController.sendMessage(
content: 'file_url',
type: MessageType.file,
metadata: {'fileName': 'document.pdf', 'size': '2.5MB'},
);
Message Features #
// Reply to message
await chatController.sendMessage(
content: 'Reply message',
replyTo: 'original_message_id',
);
// Delete message
await chatController.deleteMessage('message_id');
// Update message
await chatController.updateMessage(
messageId: 'message_id',
content: 'Updated content',
);
Customization π¨ #
Theme Customization #
ChatView(
theme: ChatTheme(
primaryColor: Colors.blue,
secondaryColor: Colors.grey[200],
userBubbleColor: Colors.blue,
otherBubbleColor: Colors.grey[300],
inputBackgroundColor: Colors.white,
// ... more theme options
),
)
Custom Bubble Builder #
ChatView(
bubbleBuilder: (context, message, isUser) {
return CustomBubble(
message: message,
isUser: isUser,
// ... your custom bubble implementation
);
},
)
Example App π± #
Check out our example app for a complete implementation of ChatVerse features.
Contributing π€ #
Contributions are welcome! Feel free to submit issues and pull requests.
Connect with Me π #
- Twitter: @hamedesam_dev
- GitHub: hamedessam
License π #
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments π #
- Thanks to all contributors who have helped make ChatVerse better
- Special thanks to the Flutter and Firebase teams for their amazing platforms