diff --git a/packages/flutter_chat/lib/src/config/chat_options.dart b/packages/flutter_chat/lib/src/config/chat_options.dart index 7760256..93fa93f 100644 --- a/packages/flutter_chat/lib/src/config/chat_options.dart +++ b/packages/flutter_chat/lib/src/config/chat_options.dart @@ -24,6 +24,7 @@ class ChatOptions { this.iconDisabledColor, this.chatAlignment, this.onNoChats, + this.imageQuality = 20, this.imageProviderResolver = _defaultImageProviderResolver, ChatRepositoryInterface? chatRepository, UserRepositoryInterface? userRepository, @@ -93,6 +94,12 @@ class ChatOptions { /// [onNoChats] is a function that is triggered when there are no chats. final Function? onNoChats; + /// [imageQuality] sets the quality of the image to send over with chat image + /// messages. This should be a value between 1 and 100 where 1 is the worst + /// image quality and 100 is the best image quality. Note that the higher the + /// image quality is set, the larger te iage is, that is being sent over. + final int imageQuality; + /// If [imageProviderResolver] is set, it will be used to get the images for /// the images in the entire userstory. If not provided, CachedNetworkImage /// will be used. diff --git a/packages/flutter_chat/lib/src/screens/creation/widgets/default_image_picker.dart b/packages/flutter_chat/lib/src/screens/creation/widgets/default_image_picker.dart index 7387468..00b684b 100644 --- a/packages/flutter_chat/lib/src/screens/creation/widgets/default_image_picker.dart +++ b/packages/flutter_chat/lib/src/screens/creation/widgets/default_image_picker.dart @@ -58,7 +58,9 @@ class DefaultImagePickerDialog extends StatelessWidget { padding: const EdgeInsets.all(8.0), color: Colors.white, child: ImagePicker( - config: const ImagePickerConfig(imageQuality: 20), + config: ImagePickerConfig( + imageQuality: options.imageQuality.clamp(0, 100), + ), theme: ImagePickerTheme( spaceBetweenIcons: 32.0, iconColor: theme.primaryColor,