Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Commit

Permalink
comment share fix (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
krawieck committed Feb 3, 2021
1 parent b0334c8 commit e627694
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/util/extensions/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ extension DisplayNames on UserSafe {
return displayName;
}
}

extension CommentLink on Comment {
String get link => 'https://$instanceHost/post/$postId/comment/$id';
}
6 changes: 3 additions & 3 deletions lib/widgets/comment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,16 @@ class CommentWidget extends HookWidget {
ListTile(
leading: const Icon(Icons.open_in_browser),
title: const Text('Open in browser'),
onTap: () async => await ul.canLaunch(com.comment.apId)
? ul.launch(com.comment.apId)
onTap: () async => await ul.canLaunch(com.comment.link)
? ul.launch(com.comment.link)
: Scaffold.of(context).showSnackBar(
const SnackBar(content: Text("can't open in browser"))),
),
ListTile(
leading: const Icon(Icons.share),
title: const Text('Share url'),
onTap: () => Share.text(
'Share comment url', com.comment.apId, 'text/plain'),
'Share comment url', com.comment.link, 'text/plain'),
),
ListTile(
leading: const Icon(Icons.share),
Expand Down

0 comments on commit e627694

Please sign in to comment.