mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-09-19 03:54:51 -04:00
updates and cleanup
This commit is contained in:
parent
6bd60207d8
commit
ef1ded4494
11 changed files with 142 additions and 108 deletions
|
@ -39,14 +39,14 @@ class ContactsBrowserElement {
|
|||
class ContactsBrowser extends StatefulWidget {
|
||||
const ContactsBrowser(
|
||||
{required this.onContactSelected,
|
||||
required this.onChatStarted,
|
||||
required this.onStartChat,
|
||||
this.selectedContactRecordKey,
|
||||
super.key});
|
||||
@override
|
||||
State<ContactsBrowser> createState() => _ContactsBrowserState();
|
||||
|
||||
final Future<void> Function(proto.Contact? contact) onContactSelected;
|
||||
final Future<void> Function(proto.Contact contact) onChatStarted;
|
||||
final Future<void> Function(proto.Contact contact) onStartChat;
|
||||
final TypedKey? selectedContactRecordKey;
|
||||
|
||||
@override
|
||||
|
@ -60,7 +60,7 @@ class ContactsBrowser extends StatefulWidget {
|
|||
'onContactSelected', onContactSelected))
|
||||
..add(
|
||||
ObjectFlagProperty<Future<void> Function(proto.Contact contact)>.has(
|
||||
'onChatStarted', onChatStarted));
|
||||
'onStartChat', onStartChat));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -238,8 +238,8 @@ class _ContactsBrowserState extends State<ContactsBrowser>
|
|||
selected: widget.selectedContactRecordKey ==
|
||||
contact.localConversationRecordKey.toVeilid(),
|
||||
disabled: false,
|
||||
onDoubleTap: _onTapContact,
|
||||
onTap: _onStartChat,
|
||||
onDoubleTap: _onStartChat,
|
||||
onTap: _onSelectContact,
|
||||
onDelete: _onDeleteContact)
|
||||
.paddingLTRB(0, 4, 0, 0);
|
||||
case ContactsBrowserElementKind.invitation:
|
||||
|
@ -293,12 +293,12 @@ class _ContactsBrowserState extends State<ContactsBrowser>
|
|||
]);
|
||||
}
|
||||
|
||||
Future<void> _onTapContact(proto.Contact contact) async {
|
||||
Future<void> _onSelectContact(proto.Contact contact) async {
|
||||
await widget.onContactSelected(contact);
|
||||
}
|
||||
|
||||
Future<void> _onStartChat(proto.Contact contact) async {
|
||||
await widget.onChatStarted(contact);
|
||||
await widget.onStartChat(contact);
|
||||
}
|
||||
|
||||
Future<void> _onDeleteContact(proto.Contact contact) async {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue