From ccedb352595ae44dfe097cdf26640d31d9d68640 Mon Sep 17 00:00:00 2001 From: krawieck Date: Sat, 16 Jan 2021 15:20:49 +0100 Subject: [PATCH] add button for going to post --- lib/widgets/comment.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/widgets/comment.dart b/lib/widgets/comment.dart index 4d62522..c45d6b9 100644 --- a/lib/widgets/comment.dart +++ b/lib/widgets/comment.dart @@ -25,6 +25,7 @@ class Comment extends HookWidget { final int indent; final int postCreatorId; final CommentTree commentTree; + final bool detatched; final bool wasVoted; @@ -40,6 +41,7 @@ class Comment extends HookWidget { this.commentTree, { this.indent = 0, @required this.postCreatorId, + this.detatched = false, }) : wasVoted = (commentTree.comment.myVote ?? VoteType.none) != VoteType.none; @@ -279,6 +281,14 @@ class Comment extends HookWidget { content: Text('comment copied to clipboard')))); }), const Spacer(), + if (detatched) + _CommentAction( + icon: Icons.link, + // onPressed: () {}, + onPressed: () => + goToPost(context, comment.instanceHost, comment.postId), + tooltip: 'go to post', + ), _CommentAction( icon: Icons.more_horiz, onPressed: () => _openMoreMenu(context),