reddit_style_comments 0.0.2
reddit_style_comments: ^0.0.2 copied to clipboard
A highly customizable Flutter package for building recursive, Reddit-style threaded comment trees with support for voting logic, nested replies, and smooth animations.
Reddit Style Comments #
A highly customizable Flutter package for building recursive, Reddit-style threaded comment trees. It handles the complex logic of nesting, indentation, and thread lines automatically, allowing you to focus on your app's unique style and logic.
✨ Features #
- Recursive Nesting: Supports infinite levels of nested replies with automatic indentation.
- Smart Interaction: Built-in callbacks for upvoting, downvoting, replying, and reporting.
- Animated UI: Smooth scaling animations for voting actions powered by
flutter_animate. - Highly Customizable: * Control background, text, and active/inactive vote colors.
- Customizable vertical thread lines to visualize comment depth.
- Support for both Network and Asset avatars.
- Performance Optimized: Uses a non-blocking
Columnbased recursive approach to prevent layout crashes.
📸 Media #
| GIF | Screen Shot |
|---|---|
![]() |
![]() |
🚀 Getting Started #
Installation #
Add the dependency to your pubspec.yaml:
dependencies:
reddit_style_comments: ^0.0.1
```dart
import 'package:reddit_style_comments/reddit_style_comments.dart';
// ... inside your build method
RedditStyleComments(
comment: myCommentObject,
backgroundColor: const Color(0xFF1A1A1B),
onUpvote: (comment) => print("Upvoted ${comment.id}"),
onDownvote: (comment) => print("Downvoted ${comment.id}"),
onReply: (comment) => openReplySheet(comment),
)
.gif)
.jpg)