From 35dcc24e663682d2abb1d982626e7f772b0aaa25 Mon Sep 17 00:00:00 2001 From: Nima Boscarino Date: Sat, 6 Nov 2021 10:53:42 -0700 Subject: [PATCH] Remove resolved TODO statements, and destroy modal after copying link --- lib/widgets/messagebubble.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/widgets/messagebubble.dart b/lib/widgets/messagebubble.dart index 39a8f9a3..128b9fab 100644 --- a/lib/widgets/messagebubble.dart +++ b/lib/widgets/messagebubble.dart @@ -68,7 +68,7 @@ class MessageBubbleState extends State { text: widget.content + '\u202F', // TODO: onOpen breaks the "selectable" functionality. Maybe something to do with gesture handler? options: LinkifyOptions(humanize: false), - linkifiers: [UrlLinkifier()], // TODO: double-check on this (only web links to avoid Android messiness) + linkifiers: [UrlLinkifier()], onOpen: (link) { _modalOpenLink(context, link); }, @@ -122,7 +122,6 @@ class MessageBubbleState extends State { context: ctx, builder: (BuildContext bcontext) { return Container( - // TODO: Ask re: hard-coded height height: 200, // bespoke value courtesy of the [TextField] docs child: Center( child: Padding( @@ -134,7 +133,6 @@ class MessageBubbleState extends State { Text( "Opening this link will launch an application outside of Cwtch and may reveal metadata or otherwise compromise the security of Cwtch. Only open links from people you trust. Are you sure you want to continue?" ), - // TODO: Ask about styling preferences (should this be a reusable "inline-button"?) Flex(direction: Axis.horizontal, mainAxisAlignment: MainAxisAlignment.center, children: [ Container( margin: EdgeInsets.symmetric(vertical: 20, horizontal: 10), @@ -143,10 +141,11 @@ class MessageBubbleState extends State { onPressed: () { Clipboard.setData(new ClipboardData(text: link.url)); - // TODO: Ask about desired SnackBar + modal behaviour final snackBar = SnackBar( content: Text(AppLocalizations.of(context)!.copiedClipboardNotification), ); + + Navigator.pop(bcontext); ScaffoldMessenger.of(context).showSnackBar(snackBar); }, ),