mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-24 15:05:22 -04:00
clean up context locators
This commit is contained in:
parent
751022e743
commit
2ccad50f9a
31 changed files with 603 additions and 542 deletions
|
@ -28,13 +28,31 @@ class ChatSingleContactItemWidget extends StatelessWidget {
|
|||
_contact.localConversationRecordKey.toVeilid();
|
||||
final selected = activeChatCubit.state == localConversationRecordKey;
|
||||
|
||||
late final String title;
|
||||
late final String subtitle;
|
||||
if (_contact.nickname.isNotEmpty) {
|
||||
title = _contact.nickname;
|
||||
if (_contact.profile.pronouns.isNotEmpty) {
|
||||
subtitle = '${_contact.profile.name} (${_contact.profile.pronouns})';
|
||||
} else {
|
||||
subtitle = _contact.profile.name;
|
||||
}
|
||||
} else {
|
||||
title = _contact.profile.name;
|
||||
if (_contact.profile.pronouns.isNotEmpty) {
|
||||
subtitle = '(${_contact.profile.pronouns})';
|
||||
} else {
|
||||
subtitle = '';
|
||||
}
|
||||
}
|
||||
|
||||
return SliderTile(
|
||||
key: ObjectKey(_contact),
|
||||
disabled: _disabled,
|
||||
selected: selected,
|
||||
tileScale: ScaleKind.secondary,
|
||||
title: _contact.editedProfile.name,
|
||||
subtitle: _contact.editedProfile.pronouns,
|
||||
title: title,
|
||||
subtitle: subtitle,
|
||||
icon: Icons.chat,
|
||||
onTap: () {
|
||||
singleFuture(activeChatCubit, () async {
|
||||
|
|
|
@ -53,10 +53,13 @@ class ChatSingleContactListWidget extends StatelessWidget {
|
|||
if (contact == null) {
|
||||
return false;
|
||||
}
|
||||
return contact.editedProfile.name
|
||||
return contact.nickname
|
||||
.toLowerCase()
|
||||
.contains(lowerValue) ||
|
||||
contact.editedProfile.pronouns
|
||||
contact.profile.name
|
||||
.toLowerCase()
|
||||
.contains(lowerValue) ||
|
||||
contact.profile.pronouns
|
||||
.toLowerCase()
|
||||
.contains(lowerValue);
|
||||
}).toList();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue