Skip to content

Commit

Permalink
TW-1139: Add toast message when copying message
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhhdev authored and hoangdat committed Jan 24, 2025
1 parent ca18fd7 commit 4153c77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3103,5 +3103,6 @@
"phoneNumberCopiedToClipboard": "Phone number copied to clipboard",
"deleteAccountMessage": "Groups chats that you have created will remain unadministered unless you have given another user administrator rights. Users will still have a history of messages with you. Deleting the account won't help.",
"deleteLater": "Delete later",
"areYouSureYouWantToDeleteAccount": "Are you sure you want to delete account?"
"areYouSureYouWantToDeleteAccount": "Are you sure you want to delete account?",
"textCopiedToClipboard": "Text copied to clipboard"
}
4 changes: 4 additions & 0 deletions lib/utils/matrix_sdk_extensions/event_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ extension LocalizedBody on Event {
Future<void> copyTextEvent(BuildContext context, Timeline timeline) async {
await TwakeClipboard.instance
.copyText(getSelectedEventString(context, timeline));
TwakeSnackBar.show(
context,
L10n.of(context)!.textCopiedToClipboard,
);
}

String getSelectedEventString(BuildContext context, Timeline timeline) {
Expand Down

0 comments on commit 4153c77

Please sign in to comment.