mirror of
https://github.com/Iconica-Development/flutter_chat.git
synced 2025-05-18 18:33:49 +02:00
bugfix: add imageQuality with default 20 value to options of flutter chat.
This commit is contained in:
parent
ad4cf1e37b
commit
c63efadd2c
2 changed files with 10 additions and 1 deletions
|
@ -26,6 +26,7 @@ class ChatOptions {
|
||||||
this.iconDisabledColor,
|
this.iconDisabledColor,
|
||||||
this.chatAlignment,
|
this.chatAlignment,
|
||||||
this.onNoChats,
|
this.onNoChats,
|
||||||
|
this.imageQuality = 20,
|
||||||
this.imageProviderResolver = _defaultImageProviderResolver,
|
this.imageProviderResolver = _defaultImageProviderResolver,
|
||||||
ChatRepositoryInterface? chatRepository,
|
ChatRepositoryInterface? chatRepository,
|
||||||
UserRepositoryInterface? userRepository,
|
UserRepositoryInterface? userRepository,
|
||||||
|
@ -98,6 +99,12 @@ class ChatOptions {
|
||||||
/// [onNoChats] is a function that is triggered when there are no chats.
|
/// [onNoChats] is a function that is triggered when there are no chats.
|
||||||
final Function? onNoChats;
|
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
|
/// If [imageProviderResolver] is set, it will be used to get the images for
|
||||||
/// the images in the entire userstory. If not provided, CachedNetworkImage
|
/// the images in the entire userstory. If not provided, CachedNetworkImage
|
||||||
/// will be used.
|
/// will be used.
|
||||||
|
|
|
@ -59,7 +59,9 @@ class DefaultImagePickerDialog extends StatelessWidget {
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: ImagePicker(
|
child: ImagePicker(
|
||||||
config: const ImagePickerConfig(imageQuality: 20),
|
config: ImagePickerConfig(
|
||||||
|
imageQuality: options.imageQuality.clamp(0, 100),
|
||||||
|
),
|
||||||
theme: ImagePickerTheme(
|
theme: ImagePickerTheme(
|
||||||
spaceBetweenIcons: 32.0,
|
spaceBetweenIcons: 32.0,
|
||||||
iconColor: theme.primaryColor,
|
iconColor: theme.primaryColor,
|
||||||
|
|
Loading…
Reference in a new issue