fix: add ability to set the color of the CircularProgressIndicator of the ImageLoadingSnackbar

This was standard grey and not changeable which was needed
This commit is contained in:
Jacques 2025-02-26 11:08:30 +01:00
parent c1c3aab808
commit c0f0d87356
2 changed files with 26 additions and 16 deletions

View file

@ -23,6 +23,7 @@
- Added imageProviderResolver to the ChatOptions to resolve ImageProvider for all images in the userstory - 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 enabled boolean to the messageInputBuilder and made parameters named
- Added autoScrollTriggerOffset to the ChatPaginationControls to adjust when the auto scroll should be enabled - 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 ## 4.0.0
- Move to the new user story architecture - Move to the new user story architecture

View file

@ -18,7 +18,7 @@ Future<void> onPressSelectImage(
if (!context.mounted) return; if (!context.mounted) return;
var messenger = ScaffoldMessenger.of(context) var messenger = ScaffoldMessenger.of(context)
..showSnackBar( ..showSnackBar(
_getImageLoadingSnackbar(options.translations), _getImageLoadingSnackbar(context, options.translations),
) )
..activate(); ..activate();
await onUploadImage(image); await onUploadImage(image);
@ -87,14 +87,22 @@ class DefaultImagePickerDialog extends StatelessWidget {
} }
} }
SnackBar _getImageLoadingSnackbar(ChatTranslations translations) => SnackBar( SnackBar _getImageLoadingSnackbar(
BuildContext context,
ChatTranslations translations,
) {
var theme = Theme.of(context);
return SnackBar(
duration: const Duration(minutes: 1), duration: const Duration(minutes: 1),
content: Row( content: Row(
children: [ children: [
const SizedBox( SizedBox(
width: 25, width: 25,
height: 25, height: 25,
child: CircularProgressIndicator(color: Colors.grey), child: CircularProgressIndicator(
color: theme.snackBarTheme.actionTextColor ?? Colors.grey,
),
), ),
Padding( Padding(
padding: const EdgeInsets.only(left: 16.0), padding: const EdgeInsets.only(left: 16.0),
@ -103,3 +111,4 @@ SnackBar _getImageLoadingSnackbar(ChatTranslations translations) => SnackBar(
], ],
), ),
); );
}