You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h5align="center">The most complete Chat UI for flutter</h5>
5
5
<palign="center">Inspired by <ahref="https://github.com/FaridSafi/react-native-gifted-chat">react-native-gifted-chat.</a>
6
6
Highly customizable and helps developing chat UI faster.
7
7
</p>
8
8
</p>
9
9
10
-
###Usage 💻
10
+
## Usage 💻
11
11
12
12
To use this package, add `dash_chat` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).
13
13
14
-
###Features 🔮
14
+
## Features 🔮
15
15
16
16
- Fully customizable components
17
17
- Copy messages to clipboard
18
18
- Multi-line TextInput
19
19
- Touchable links using [flutter_parsed_text](https://pub.dev/packages/flutter_parsed_text)
20
-
- Avatar as user's initials - WIP
21
-
- Quick Reply messages - WIP
22
-
- Load earlier messages -WIP
23
-
- Scroll to bottom - WIP
24
-
- System message - WIP
25
-
- Composer actions (to attach photos, etc.) -WIP
20
+
- Avatar as user's initials
21
+
- Quick Reply messages
22
+
- Load earlier messages
23
+
- Scroll to bottom Widget
24
+
- Composer actions (to attach photos, etc.) - WIP
26
25
27
26
### Message object 📦
28
27
> example, Chat Message
@@ -59,38 +58,47 @@ ChatMessage(
59
58
),
60
59
```
61
60
62
-
###Parameters ⚙️
61
+
## Parameters ⚙️
63
62
64
-
-`messageContainerFlex` (int) - Flex value for the messeage container defaults to 1
65
-
-`height` (double) - Height for the Dash chat Widget
66
-
-`width` (double) - Width for the Dash chat Widget
67
-
-`messages` (List<ChatMessage>) - List of messages to display in the chat
68
-
-`text` (String) - [optional parameter] If provided will stop using the default controller
63
+
-`messageContainerFlex` (int) - Flex value for the messeage container defaults to `1`
64
+
-`height` (double) - Height for the Dash chat Widget.
65
+
-`width` (double) - Width for the Dash chat Widget.
66
+
-`messages` (List<ChatMessage>) - List of messages to display in the chat.
67
+
-`text` (String) - [optional parameter] If provided will stop using the default controller.
69
68
-`onTextChange` (Function(String)) - If the text parameter is passed then onTextChange must also be passed.
70
-
-`inputDecoration` (InputDecoration) - Used to provide input decoration to the text
71
-
-`messageIdGenerator` (String Function) - Usually new message added by the user gets UUID v4 String generater by [uuid](https://pub.dev/packages/uuid)
72
-
-`user` (ChatUser) - The current user object
73
-
-`onSend` (Function(ChatMessage)) - Callback when sending a message
74
-
-`alwaysShowSend` (bool) - Should the send button be always active defaults to false
75
-
-`dateFormat` (DateFormat) - Format to use for rendering date default is `yyyy-MM-dd`
76
-
-`timeFormat` (DateFormat) - Format to use for rendering time default is `HH:mm:ss`
77
-
-`showUserAvatar` (bool) - Should the user avatar be shown
78
-
-`showAvatarForEveryMessage` (bool) - Should the avatar be shown for every message defaulst to false
69
+
-`inputDecoration` (InputDecoration) - Used to provide input decoration to the text.
70
+
-`messageIdGenerator` (String Function) - Usually new message added by the user gets UUID v4 String generater by [uuid](https://pub.dev/packages/uuid).
-`onSend` (Function(ChatMessage)) - Callback when sending a message.
82
+
-`alwaysShowSend` (bool) - Should the send button be always active defaults to false.
83
+
-`dateFormat` (DateFormat) - Format to use for rendering date default is `yyyy-MM-dd`.
84
+
-`timeFormat` (DateFormat) - Format to use for rendering time default is `HH:mm:ss`.
85
+
-`showUserAvatar` (bool) - Should the user avatar be shown.
86
+
-`showAvatarForEveryMessage` (bool) - Should the avatar be shown for every message defaults to false.
79
87
-`onPressAvatar` (Function(ChatUser)) - Callback funtion when avatar is tapped on.
80
88
-`onLongPressAvatar` (Function(ChatUser)) - Callback funtion when avatar is long pressed on.
81
89
-`onLongPressMessage` (Function(ChatUser)) - Callback funtion when message is long pressed on.
82
90
-`inverted` (bool) - Should the messages be shown in reversed order
83
-
-`avatarBuilder` (Widget Function(ChatUser)) - Will override the the default avatar
84
-
-`messageBuilder` (Widget Function(ChatMessage)) - Will override the the default message widget
85
-
-`messageTextBuilder` (Widget Function(String)) - Will override the the default message text widget
91
+
-`avatarBuilder` (Widget Function(ChatUser)) - Will override the the default avatar.
92
+
-`messageBuilder` (Widget Function(ChatMessage)) - Will override the the default message widget.
93
+
-`messageTextBuilder` (Widget Function(String)) - Will override the the default message text widget.
86
94
-`messageImageBuilder` (Widget Function(String)) - Will override the the default message imaeg widget
87
-
-`messageTimeBuilder` (Widget Function(String)) - Will override the the default message time widget
88
-
-`dateBuilder` (Widget Function(String)) - Will override the the default chat view date widget
89
-
-`sendButtonBuilder` (Widget Function(Function)) - Will override the the default send button widget
95
+
-`messageTimeBuilder` (Widget Function(String)) - Will override the the default message time widget.
96
+
-`dateBuilder` (Widget Function(String)) - Will override the the default chat view date widget.
97
+
-`sendButtonBuilder` (Widget Function(Function)) - Will override the the default send button widget.
90
98
-`chatFooterBuilder` (Widget Function) - A Widget that will be shown below the MessageListView like you can a "tying..." Text Widget at the end.
91
-
-`inputFooterBuilder` (Widget Function) - A Widget that will be shown below the ChatInputToolbar
92
-
-`maxInputLength` (int) - Main input length of the input text box defaulst to no limit
93
-
-`parsePatterns` (List<MatchText>) - Used to parse text to make a linkified text uses [flutter_parsed_text](https://pub.dev/packages/flutter_parsed_text)
99
+
-`inputFooterBuilder` (Widget Function) - A Widget that will be shown below the ChatInputToolbar.
100
+
-`maxInputLength` (int) - Main input length of the input text box defaulst to no limit.
101
+
-`parsePatterns` (List<MatchText>) - Used to parse text to make a linkified text uses [flutter_parsed_text](https://pub.dev/packages/flutter_parsed_text).
94
102
```dart
95
103
DashChat(
96
104
parsePatterns: <MatchText>[
@@ -109,20 +117,21 @@ ChatMessage(
109
117
]
110
118
);
111
119
```
112
-
-`messageContainerDecoration` (BoxDecoration) - Provides a custom style to the message container
113
-
-`leading` (List<Widget>) - List of Widget to show before the TextField
114
-
-`trailing` (List<Widget>) - List of Widget to show after the TextField will remove the send button
115
-
-`inputTextStyle` (TextStyle) - Style for the TextField
If you have any suggestion for including a feature or if something doesn't work, feel free to open a Github [issue](https://github.com/fayeed/dash_chat/issues) for us to have a discussion on it.
0 commit comments