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 committed by FlutterJoey
parent b0b4121a25
commit c1181d4e84
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,19 +87,28 @@ class DefaultImagePickerDialog extends StatelessWidget {
} }
} }
SnackBar _getImageLoadingSnackbar(ChatTranslations translations) => SnackBar( SnackBar _getImageLoadingSnackbar(
duration: const Duration(minutes: 1), BuildContext context,
content: Row( ChatTranslations translations,
children: [ ) {
const SizedBox( var theme = Theme.of(context);
width: 25,
height: 25, return SnackBar(
child: CircularProgressIndicator(color: Colors.grey), 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), Padding(
child: Text(translations.imageUploading), padding: const EdgeInsets.only(left: 16.0),
), child: Text(translations.imageUploading),
], ),
), ],
); ),
);
}