mirror of
https://github.com/Iconica-Development/flutter_chat.git
synced 2025-05-18 18:33:49 +02:00
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:
parent
b0b4121a25
commit
c1181d4e84
2 changed files with 26 additions and 16 deletions
|
@ -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
|
||||
|
|
|
@ -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,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),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue