fix: add option to set a custom padding around the list of chats

This commit is contained in:
Freek van de Ven 2024-05-23 17:17:11 +02:00
parent 1eb5f99b7b
commit efd6fc138c
3 changed files with 7 additions and 1 deletions

View file

@ -6,6 +6,7 @@
- Add a enableGroupChatCreation boolean to the userstory configuration to enable or disable group chat creation
- Change the ChatTranslations constructor to require all translations or use the ChatTranslations.empty constructor if you don't want to specify all translations
- Remove the Divider between the users on the new chat screen
- Add option to set a custom padding around the list of chats
## 1.4.3

View file

@ -19,6 +19,7 @@ class ChatOptions {
this.groupAvatarBuilder = _createGroupAvatar,
this.noChatsPlaceholderBuilder = _createNoChatsPlaceholder,
this.noUsersPlaceholderBuilder = _createNoUsersPlaceholder,
this.paddingAroundChatList,
});
/// Builder function for the new chat button.
@ -47,6 +48,9 @@ class ChatOptions {
/// Builder function for the placeholder shown when no users are available.
final NoUsersPlaceholderBuilder noUsersPlaceholderBuilder;
/// The padding around the chat list.
final EdgeInsets? paddingAroundChatList;
}
Widget _createNewChatButton(

View file

@ -119,7 +119,8 @@ class _ChatScreenState extends State<ChatScreen> {
child: ListView(
controller: controller,
physics: const AlwaysScrollableScrollPhysics(),
padding: const EdgeInsets.fromLTRB(28, 16, 28, 0),
padding: widget.options.paddingAroundChatList ??
const EdgeInsets.fromLTRB(28, 16, 28, 0),
children: [
StreamBuilder<List<ChatModel>>(
stream: widget.service.chatOverviewService.getChatsStream(),