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 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

View file

@ -18,7 +18,7 @@ Future<void> onPressSelectImage(
if (!context.mounted) return;
var messenger = ScaffoldMessenger.of(context)
..showSnackBar(
_getImageLoadingSnackbar(options.translations),
_getImageLoadingSnackbar(context, options.translations),
)
..activate();
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),
content: Row(
children: [
const SizedBox(
SizedBox(
width: 25,
height: 25,
child: CircularProgressIndicator(color: Colors.grey),
child: CircularProgressIndicator(
color: theme.snackBarTheme.actionTextColor ?? Colors.grey,
),
),
Padding(
padding: const EdgeInsets.only(left: 16.0),
@ -103,3 +111,4 @@ SnackBar _getImageLoadingSnackbar(ChatTranslations translations) => SnackBar(
],
),
);
}