mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-08-03 11:49:04 -04:00
better time and status position
This commit is contained in:
parent
b8eca1161e
commit
8aaca62ea7
5 changed files with 119 additions and 116 deletions
|
@ -56,43 +56,38 @@ class ChatListWidget extends StatelessWidget {
|
|||
valueMapper: (c) => c.value);
|
||||
|
||||
final chatListV = context.watch<ChatListCubit>().state;
|
||||
return chatListV
|
||||
.builder((context, chatList) => SizedBox.expand(
|
||||
child: styledTitleContainer(
|
||||
context: context,
|
||||
title: translate('chat_list.chats'),
|
||||
child: (chatList.isEmpty)
|
||||
? const SizedBox.expand(child: EmptyChatListWidget())
|
||||
: TapRegion(
|
||||
onTapOutside: (_) {
|
||||
FocusScope.of(context).unfocus();
|
||||
},
|
||||
child: SearchableList<proto.Chat>(
|
||||
initialList: chatList.map((x) => x.value).toList(),
|
||||
itemBuilder: (c) {
|
||||
switch (c.whichKind()) {
|
||||
case proto.Chat_Kind.direct:
|
||||
return _itemBuilderDirect(
|
||||
c.direct,
|
||||
contactMap,
|
||||
);
|
||||
case proto.Chat_Kind.group:
|
||||
return const Text(
|
||||
'group chats not yet supported!');
|
||||
case proto.Chat_Kind.notSet:
|
||||
throw StateError('unknown chat kind');
|
||||
}
|
||||
},
|
||||
filter: (value) =>
|
||||
_itemFilter(contactMap, chatList, value),
|
||||
searchFieldPadding:
|
||||
const EdgeInsets.fromLTRB(0, 0, 0, 4),
|
||||
inputDecoration: InputDecoration(
|
||||
labelText: translate('chat_list.search'),
|
||||
),
|
||||
)).paddingAll(8),
|
||||
)))
|
||||
.paddingLTRB(8, 0, 8, 8);
|
||||
return chatListV.builder((context, chatList) => SizedBox.expand(
|
||||
child: styledContainer(
|
||||
context: context,
|
||||
child: (chatList.isEmpty)
|
||||
? const SizedBox.expand(child: EmptyChatListWidget())
|
||||
: TapRegion(
|
||||
onTapOutside: (_) {
|
||||
FocusScope.of(context).unfocus();
|
||||
},
|
||||
child: SearchableList<proto.Chat>(
|
||||
initialList: chatList.map((x) => x.value).toList(),
|
||||
itemBuilder: (c) {
|
||||
switch (c.whichKind()) {
|
||||
case proto.Chat_Kind.direct:
|
||||
return _itemBuilderDirect(
|
||||
c.direct,
|
||||
contactMap,
|
||||
);
|
||||
case proto.Chat_Kind.group:
|
||||
return const Text('group chats not yet supported!');
|
||||
case proto.Chat_Kind.notSet:
|
||||
throw StateError('unknown chat kind');
|
||||
}
|
||||
},
|
||||
filter: (value) =>
|
||||
_itemFilter(contactMap, chatList, value),
|
||||
searchFieldPadding: const EdgeInsets.fromLTRB(0, 0, 0, 4),
|
||||
inputDecoration: InputDecoration(
|
||||
labelText: translate('chat_list.search'),
|
||||
),
|
||||
)).paddingAll(8),
|
||||
)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue