mirror of
https://github.com/Iconica-Development/flutter_chat.git
synced 2025-05-19 10:53:51 +02:00
fix: add option to set a custom padding around the list of chats
This commit is contained in:
parent
1eb5f99b7b
commit
efd6fc138c
3 changed files with 7 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
||||||
- Add a enableGroupChatCreation boolean to the userstory configuration to enable or disable group chat creation
|
- 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
|
- 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
|
- 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
|
## 1.4.3
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ class ChatOptions {
|
||||||
this.groupAvatarBuilder = _createGroupAvatar,
|
this.groupAvatarBuilder = _createGroupAvatar,
|
||||||
this.noChatsPlaceholderBuilder = _createNoChatsPlaceholder,
|
this.noChatsPlaceholderBuilder = _createNoChatsPlaceholder,
|
||||||
this.noUsersPlaceholderBuilder = _createNoUsersPlaceholder,
|
this.noUsersPlaceholderBuilder = _createNoUsersPlaceholder,
|
||||||
|
this.paddingAroundChatList,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// Builder function for the new chat button.
|
/// Builder function for the new chat button.
|
||||||
|
@ -47,6 +48,9 @@ class ChatOptions {
|
||||||
|
|
||||||
/// Builder function for the placeholder shown when no users are available.
|
/// Builder function for the placeholder shown when no users are available.
|
||||||
final NoUsersPlaceholderBuilder noUsersPlaceholderBuilder;
|
final NoUsersPlaceholderBuilder noUsersPlaceholderBuilder;
|
||||||
|
|
||||||
|
/// The padding around the chat list.
|
||||||
|
final EdgeInsets? paddingAroundChatList;
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _createNewChatButton(
|
Widget _createNewChatButton(
|
||||||
|
|
|
@ -119,7 +119,8 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||||
child: ListView(
|
child: ListView(
|
||||||
controller: controller,
|
controller: controller,
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
padding: const EdgeInsets.fromLTRB(28, 16, 28, 0),
|
padding: widget.options.paddingAroundChatList ??
|
||||||
|
const EdgeInsets.fromLTRB(28, 16, 28, 0),
|
||||||
children: [
|
children: [
|
||||||
StreamBuilder<List<ChatModel>>(
|
StreamBuilder<List<ChatModel>>(
|
||||||
stream: widget.service.chatOverviewService.getChatsStream(),
|
stream: widget.service.chatOverviewService.getChatsStream(),
|
||||||
|
|
Loading…
Reference in a new issue