clean up context locators

This commit is contained in:
Christien Rioux 2024-06-15 23:29:15 -04:00
parent 751022e743
commit 2ccad50f9a
31 changed files with 603 additions and 542 deletions

View file

@ -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 {

View file

@ -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();