youtube_comment_tree 0.0.1 copy "youtube_comment_tree: ^0.0.1" to clipboard
youtube_comment_tree: ^0.0.1 copied to clipboard

A package that provides a widget used to replicate the comment tree view in the new youtube app

example/lib/main.dart

import 'package:youtube_comment_tree/youtube_comment_tree.dart';
import 'package:example/comment.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Comment Tree Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    const subCommentText =
        "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";

    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: const Text('Comment Tree Example'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: Column(
          children: [
            YoutubeCommentTreeWidget(
              treeColor: Theme.of(context).colorScheme.primary,
              parent: const Comment(),
              children: [
                Comment(comment: subCommentText),
                Comment(comment: subCommentText),
                Comment(comment: subCommentText),
                YoutubeCommentTreeWidget(
                  treeColor: Theme.of(context).colorScheme.primaryContainer,
                  parent: Comment(comment: subCommentText),
                  children: [
                    Comment(comment: subCommentText),
                    Comment(comment: subCommentText),
                    Comment(),
                  ],
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
160
points
3
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A package that provides a widget used to replicate the comment tree view in the new youtube app

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on youtube_comment_tree