@@ -72,6 +72,7 @@ void onSendTap(String message, ReplyMessage replyMessage){
72
72
message: "How are you",
73
73
createdAt: DateTime.now(),
74
74
sendBy: currentUser.id,
75
+ replyMessage: replyMessage,
75
76
);
76
77
chatController.addMessage(message);
77
78
}
@@ -86,11 +87,28 @@ void onSendTap(String message, ReplyMessage replyMessage){
86
87
createdAt: DateTime.now(),
87
88
sendBy: currentUser.id,
88
89
messageType: MessageType.image,
90
+ replyMessage: replyMessage,
89
91
);
90
92
chatController.addMessage(message);
91
93
}
92
94
```
93
95
96
+ 7 . Sending voice message.
97
+ ``` dart
98
+ void onRecordingComplete(String audioPath, ReplyMessage replyMessage){
99
+ final message = Message(
100
+ id: '3',
101
+ message: audioPath,
102
+ createdAt: DateTime.now(),
103
+ sendBy: currentUser.id,
104
+ messageType: MessageType.voice,
105
+ replyMessage: replyMessage,
106
+ );
107
+ chatController.addMessage(message);
108
+ }
109
+ ```
110
+ Note: This function needs to pass in ` onRecordingComplete ` parameter in ` ChatView ` class.
111
+
94
112
## Platform specific configuration for image picker
95
113
96
114
### iOS
@@ -103,9 +121,22 @@ Add the following keys to your _Info.plist_ file, located in `<project root>/ios
103
121
104
122
## Some more optional parameters
105
123
106
- 1 . Adding an appbar with ` ChatViewAppBar ` .
124
+ 1 . Enable and disable specific features with ` FeatureActiveConfig ` .
107
125
``` dart
108
126
ChatView(
127
+ ...
128
+ featureActiveConfig: FeatureActiveConfig(
129
+ enableSwipeToReply: true,
130
+ enableSwipeToSeeTime: false,
131
+ ),
132
+ ...
133
+ )
134
+ ```
135
+
136
+ 2 . Adding an appbar with ` ChatViewAppBar ` .
137
+ ``` dart
138
+ ChatView(
139
+ ...
109
140
appBar: ChatViewAppBar(
110
141
profilePicture: profileImage,
111
142
chatTitle: "Simform",
@@ -114,10 +145,11 @@ ChatView(
114
145
Icon(Icons.more_vert),
115
146
],
116
147
),
148
+ ...
117
149
)
118
150
```
119
151
120
- 2 . Adding a message list configuration with ` ChatBackgroundConfiguration ` class.
152
+ 3 . Adding a message list configuration with ` ChatBackgroundConfiguration ` class.
121
153
``` dart
122
154
ChatView(
123
155
...
@@ -129,7 +161,7 @@ ChatView(
129
161
)
130
162
```
131
163
132
- 3 . Adding a send message configuration with ` SendMessageConfiguration ` class.
164
+ 4 . Adding a send message configuration with ` SendMessageConfiguration ` class.
133
165
``` dart
134
166
ChatView(
135
167
...
@@ -138,23 +170,11 @@ ChatView(
138
170
replyDialogColor:Colors.blue,
139
171
replyTitleColor: Colors.black,
140
172
closeIconColor: Colors.black,
141
- horizontalDragToShowMessageTime: true, // to show message created time
142
173
),
143
174
...
144
175
)
145
176
```
146
177
147
- 4 . Adding a receiver's profile image.
148
- ``` dart
149
- ChatView(
150
- ...
151
- showReceiverProfileCircle: true,
152
- profileCircleConfig: ProfileCircleConfiguration(profileImageUrl: profileImage),
153
- /// Add profileImage url of recevier
154
- ...
155
- )
156
- ```
157
-
158
178
5 . Adding a chat bubble configuration with ` ChatBubbleConfiguration ` class.
159
179
``` dart
160
180
ChatView(
@@ -227,9 +247,11 @@ ChatView(
227
247
...
228
248
reactionPopupConfig: ReactionPopupConfiguration(
229
249
backgroundColor: Colors.white,
230
- onEmojiTap: (emoji, messageId){
231
- chatController.setReaction(emoji,messageId);
232
- },
250
+ padding: EdgeInsets.all(12),
251
+ shadow: BoxShadow(
252
+ color: Colors.black54,
253
+ blurRadius: 20,
254
+ ),
233
255
),
234
256
...
235
257
)
@@ -314,7 +336,9 @@ ChatView(
314
336
ChatView(
315
337
...
316
338
isLastPage: false,
317
- enablePagination: true,
339
+ featureActiveConfig: FeatureActiveConfig(
340
+ enablePagination: true,
341
+ ),
318
342
loadMoreData: chatController.loadMoreData,
319
343
...
320
344
)
@@ -363,6 +387,19 @@ ChatView(
363
387
...
364
388
)
365
389
```
390
+
391
+ 17 . Setting auto scroll and highlight config with ` RepliedMsgAutoScrollConfig ` class.
392
+ ``` dart
393
+ ChatView(
394
+ ...
395
+ repliedMsgAutoScrollConfig: RepliedMsgAutoScrollConfig(
396
+ enableHighlightRepliedMsg: true,
397
+ highlightColor: Colors.grey,
398
+ highlightScale: 1.1,
399
+ )
400
+ ...
401
+ )
402
+ ```
366
403
## How to use
367
404
368
405
Check out the ** example** app in the [ example] ( https://github.com/SimformSolutionsPvtLtd/flutter_chatview/tree/main/example ) directory or the 'Example' tab on pub.dartlang.org for a more complete example.
0 commit comments