better time and status position

This commit is contained in:
Christien Rioux 2025-05-28 13:34:57 -05:00
parent b8eca1161e
commit 8aaca62ea7
5 changed files with 119 additions and 116 deletions

View file

@ -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),
)));
});
}
}