Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
fix endless loading on comments (fixes mdanics#87 and mdanics#97) (md…
Browse files Browse the repository at this point in the history
  • Loading branch information
mdanics authored Jul 5, 2020
1 parent b15a4aa commit 30c1fa4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/comment_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ class _CommentScreenState extends State<CommentScreen> {
),
trailing: OutlineButton(onPressed: (){addComment(_commentController.text);}, borderSide: BorderSide.none, child: Text("Post"),),
),

],
);

}


Expand Down Expand Up @@ -88,7 +86,6 @@ class _CommentScreenState extends State<CommentScreen> {
data.documents.forEach((DocumentSnapshot doc) {
comments.add(Comment.fromDocument(doc));
});

return comments;
}

Expand All @@ -101,7 +98,7 @@ class _CommentScreenState extends State<CommentScreen> {
.add({
"username": currentUserModel.username,
"comment": comment,
"timestamp": DateTime.now(),
"timestamp": Timestamp.now(),
"avatarUrl": currentUserModel.photoUrl,
"userId": currentUserModel.id
});
Expand All @@ -117,7 +114,7 @@ class _CommentScreenState extends State<CommentScreen> {
"type": "comment",
"userProfileImg": currentUserModel.photoUrl,
"commentData": comment,
"timestamp": DateTime.now(),
"timestamp": Timestamp.now(),
"postId": postId,
"mediaUrl": postMediaUrl,
});
Expand All @@ -129,7 +126,7 @@ class Comment extends StatelessWidget {
final String userId;
final String avatarUrl;
final String comment;
final String timestamp;
final Timestamp timestamp;

Comment(
{this.username,
Expand Down

0 comments on commit 30c1fa4

Please sign in to comment.