From d64ca68f25ac6cc9053cb2140e1e06194cdee509 Mon Sep 17 00:00:00 2001 From: erinn Date: Tue, 11 May 2021 15:56:16 -0700 Subject: [PATCH] addressing comments on #77 --- LIBCWTCH-GO.version | 2 +- lib/views/messageview.dart | 3 +++ lib/widgets/DropdownContacts.dart | 4 ++++ lib/widgets/invitationbubble.dart | 4 ++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/LIBCWTCH-GO.version b/LIBCWTCH-GO.version index 115c0b6..b602ad1 100644 --- a/LIBCWTCH-GO.version +++ b/LIBCWTCH-GO.version @@ -1 +1 @@ -v0.0.2-24-ga1095b7-2021-05-11-00-13 \ No newline at end of file +v0.0.2-28-gbef54c6-2021-05-11-22-38 \ No newline at end of file diff --git a/lib/views/messageview.dart b/lib/views/messageview.dart index 3ccf70e..f163348 100644 --- a/lib/views/messageview.dart +++ b/lib/views/messageview.dart @@ -145,6 +145,9 @@ class _MessageViewState extends State { void placeHolder() => {}; + // explicitly passing BuildContext ctx here is important, change at risk to own health + // otherwise some Providers will become inaccessible to subwidgets...? + // https://stackoverflow.com/a/63818697 void _modalSendInvitation(BuildContext ctx) { showModalBottomSheet( context: ctx, diff --git a/lib/widgets/DropdownContacts.dart b/lib/widgets/DropdownContacts.dart index 49fbe3d..9ea288e 100644 --- a/lib/widgets/DropdownContacts.dart +++ b/lib/widgets/DropdownContacts.dart @@ -3,6 +3,10 @@ import 'package:provider/provider.dart'; import '../model.dart'; +// Dropdown menu populated from Provider.of's contact list +// Includes both peers and groups; begins empty/nothing selected +// Displays nicknames to UI but uses handles as values +// Pass an onChanged handler to access value class DropdownContacts extends StatefulWidget { DropdownContacts({this.onChanged,}); final Function(dynamic) onChanged; diff --git a/lib/widgets/invitationbubble.dart b/lib/widgets/invitationbubble.dart index bb8cff8..32fcc41 100644 --- a/lib/widgets/invitationbubble.dart +++ b/lib/widgets/invitationbubble.dart @@ -8,6 +8,9 @@ import 'package:intl/intl.dart'; import '../settings.dart'; +// Like MessageBubble but for displaying chat overlay 100/101 invitations +// Offers the user an accept/reject button if they don't have a matching contact already +// todo: Reject buttons currently aren't tracked and will reset when the message is reloaded class InvitationBubble extends StatefulWidget { @override InvitationBubbleState createState() => InvitationBubbleState(); @@ -43,6 +46,7 @@ class InvitationBubbleState extends State { var wdgSender = Center(widthFactor:1, child: SelectableText(senderDisplayStr + '\u202F', style: TextStyle(fontSize: 9.0, color: fromMe ? Provider.of(context).theme.messageFromMeTextColor() : Provider.of(context).theme.messageFromOtherTextColor()))); + // todo: translations var messageStr = ""; if (fromMe) { //todo: get group name?