INNER CODE UNIT · Dart

CommentController

RivaanRanawat/tiktok-flutter-clone · lib/controllers/comment_controller.dart:6

class CommentController extends GetxController {
  final Rx<List<Comment>> _comments = Rx<List<Comment>>([]);
  List<Comment> get comments => _comments.value;

  String _postId = "";

  updatePostId(String id) {
    _postId = id;
    getComment();
  }

  getComment() async {
    _comments.bindStream(
      firestore
          .collection('videos')
          .doc(_postId)
          .collection('comments')
          .snapshots()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…