@@ -30,7 +30,7 @@ import '../values/typedefs.dart';
30
30
31
31
class SendMessageConfiguration {
32
32
/// Used to give background color to text field.
33
- final Color ? textFieldBackgroundColor;
33
+ final Color textFieldBackgroundColor;
34
34
35
35
/// Used to give color to send button.
36
36
final Color ? defaultSendButtonColor;
@@ -39,16 +39,16 @@ class SendMessageConfiguration {
39
39
final Widget ? sendButtonIcon;
40
40
41
41
/// Used to give reply dialog color.
42
- final Color ? replyDialogColor;
42
+ final Color replyDialogColor;
43
43
44
44
/// Used to give color to title of reply pop-up.
45
- final Color ? replyTitleColor;
45
+ final Color replyTitleColor;
46
46
47
47
/// Used to give color to reply message.
48
- final Color ? replyMessageColor;
48
+ final Color replyMessageColor;
49
49
50
50
/// Used to give color to close icon in reply pop-up.
51
- final Color ? closeIconColor;
51
+ final Color closeIconColor;
52
52
53
53
/// Provides configuration of image picker functionality.
54
54
final ImagePickerIconsConfiguration ? imagePickerIconsConfig;
@@ -57,7 +57,7 @@ class SendMessageConfiguration {
57
57
final ImagePickerConfiguration ? imagePickerConfiguration;
58
58
59
59
/// Provides configuration of text field.
60
- final TextFieldConfiguration ? textFieldConfig;
60
+ final TextFieldConfiguration textFieldConfig;
61
61
62
62
/// Enable/disable voice recording. Enabled by default.
63
63
final bool allowRecordingVoice;
@@ -77,20 +77,23 @@ class SendMessageConfiguration {
77
77
/// Configuration for cancel voice recording
78
78
final CancelRecordConfiguration ? cancelRecordConfiguration;
79
79
80
+ bool get allowImageSending =>
81
+ enableCameraImagePicker || enableGalleryImagePicker;
82
+
80
83
const SendMessageConfiguration ({
81
- this .textFieldConfig,
82
- this .textFieldBackgroundColor,
84
+ this .textFieldConfig = const TextFieldConfiguration () ,
85
+ this .textFieldBackgroundColor = Colors .white ,
83
86
this .imagePickerIconsConfig,
84
87
this .imagePickerConfiguration,
85
88
this .defaultSendButtonColor,
86
89
this .sendButtonIcon,
87
- this .replyDialogColor,
88
- this .replyTitleColor,
89
- this .replyMessageColor,
90
- this .closeIconColor,
90
+ this .replyDialogColor = const Color . fromRGBO ( 238 , 238 , 238 , 1 ) ,
91
+ this .replyTitleColor = Colors .deepPurple ,
92
+ this .replyMessageColor = Colors .black ,
93
+ this .closeIconColor = Colors .black ,
91
94
this .allowRecordingVoice = true ,
92
- this .enableCameraImagePicker = true ,
93
95
this .enableGalleryImagePicker = true ,
96
+ this .enableCameraImagePicker = true ,
94
97
this .voiceRecordingConfiguration,
95
98
this .micIconColor,
96
99
this .cancelRecordConfiguration,
@@ -118,6 +121,32 @@ class ImagePickerIconsConfiguration {
118
121
});
119
122
}
120
123
124
+ class ImagePickerConfiguration {
125
+ /// Used to give max width of image.
126
+ final double ? maxWidth;
127
+
128
+ /// Used to give max height of image.
129
+ final double ? maxHeight;
130
+
131
+ /// Used to give image quality.
132
+ final int ? imageQuality;
133
+
134
+ /// Preferred camera device to pick image from.
135
+ final CameraDevice ? preferredCameraDevice;
136
+
137
+ /// Callback when image is picked from camera or gallery,
138
+ /// we can perform our task on image like adding crop options and return new image path
139
+ final Future <String ?> Function (String ? path)? onImagePicked;
140
+
141
+ const ImagePickerConfiguration ({
142
+ this .maxWidth,
143
+ this .maxHeight,
144
+ this .imageQuality,
145
+ this .preferredCameraDevice,
146
+ this .onImagePicked,
147
+ });
148
+ }
149
+
121
150
class TextFieldConfiguration {
122
151
/// Used to give max lines in text field.
123
152
final int ? maxLines;
@@ -140,6 +169,9 @@ class TextFieldConfiguration {
140
169
/// Used to give text style of actual text in text field.
141
170
final TextStyle ? textStyle;
142
171
172
+ /// Used to give a border to the text field.
173
+ final BoxBorder ? border;
174
+
143
175
/// Used to give border radius in text field.
144
176
final BorderRadius ? borderRadius;
145
177
@@ -171,6 +203,7 @@ class TextFieldConfiguration {
171
203
const TextFieldConfiguration ({
172
204
this .contentPadding,
173
205
this .maxLines,
206
+ this .border,
174
207
this .borderRadius,
175
208
this .hintText,
176
209
this .hintStyle,
@@ -187,32 +220,6 @@ class TextFieldConfiguration {
187
220
});
188
221
}
189
222
190
- class ImagePickerConfiguration {
191
- /// Used to give max width of image.
192
- final double ? maxWidth;
193
-
194
- /// Used to give max height of image.
195
- final double ? maxHeight;
196
-
197
- /// Used to give image quality.
198
- final int ? imageQuality;
199
-
200
- /// Preferred camera device to pick image from.
201
- final CameraDevice ? preferredCameraDevice;
202
-
203
- /// Callback when image is picked from camera or gallery,
204
- /// we can perform our task on image like adding crop options and return new image path
205
- final Future <String ?> Function (String ? path)? onImagePicked;
206
-
207
- const ImagePickerConfiguration ({
208
- this .maxWidth,
209
- this .maxHeight,
210
- this .imageQuality,
211
- this .preferredCameraDevice,
212
- this .onImagePicked,
213
- });
214
- }
215
-
216
223
class VoiceRecordingConfiguration {
217
224
/// Styling configuration for the recorder widget as well as
218
225
/// configuring the audio recording quality.
0 commit comments