diff --git a/CHANGELOG.md b/CHANGELOG.md index f578879..2ec2d57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - Added imageProviderResolver to the ChatOptions to resolve ImageProvider for all images in the userstory - Added enabled boolean to the messageInputBuilder and made parameters named - Added autoScrollTriggerOffset to the ChatPaginationControls to adjust when the auto scroll should be enabled +- Added the ability to set the color of the CircularProgressIndicator of the ImageLoadingSnackbar by theme.snackBarTheme.actionTextColor ## 4.0.0 - Move to the new user story architecture 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 2e1e399..9cacb9d 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 @@ -18,7 +18,7 @@ Future onPressSelectImage( if (!context.mounted) return; var messenger = ScaffoldMessenger.of(context) ..showSnackBar( - _getImageLoadingSnackbar(options.translations), + _getImageLoadingSnackbar(context, options.translations), ) ..activate(); await onUploadImage(image); @@ -87,19 +87,28 @@ class DefaultImagePickerDialog extends StatelessWidget { } } -SnackBar _getImageLoadingSnackbar(ChatTranslations translations) => SnackBar( - duration: const Duration(minutes: 1), - content: Row( - children: [ - const SizedBox( - width: 25, - height: 25, - child: CircularProgressIndicator(color: Colors.grey), +SnackBar _getImageLoadingSnackbar( + BuildContext context, + ChatTranslations translations, +) { + var theme = Theme.of(context); + + return SnackBar( + duration: const Duration(minutes: 1), + content: Row( + children: [ + SizedBox( + width: 25, + height: 25, + child: CircularProgressIndicator( + color: theme.snackBarTheme.actionTextColor ?? Colors.grey, ), - Padding( - padding: const EdgeInsets.only(left: 16.0), - child: Text(translations.imageUploading), - ), - ], - ), - ); + ), + Padding( + padding: const EdgeInsets.only(left: 16.0), + child: Text(translations.imageUploading), + ), + ], + ), + ); +}