fix(ui,localization): change label displayed when there is no photo or videos to attach

This commit is contained in:
Rafał Adasiewicz
2023-01-26 12:43:34 +01:00
parent 9b22eb9fd7
commit dfe82e6e47
15 changed files with 46 additions and 3 deletions
@@ -4,6 +4,9 @@
- [[#1424]](https://github.com/GetStream/stream-chat-flutter/issues/1424) Fixed a render issue when showing messages starting with 4 whitespaces.
- Fixed a bug where the `AttachmentPickerBottomSheet` was not able to identify the mobile browser.
✅ Added
- New `noPhotoOrVideoLabel` displayed when there is no files to choose.
## 5.2.0
✅ Added
@@ -18,6 +18,9 @@ abstract class Translations {
/// The label for showing no users
String get noUsersLabel;
/// The label for showing no photo or video
String get noPhotoOrVideoLabel;
/// The text for showing user is online
String get userOnlineText;
@@ -373,6 +376,9 @@ class DefaultTranslations implements Translations {
@override
String get noUsersLabel => 'There are no users currently';
@override
String get noPhotoOrVideoLabel => 'There is no photo or video';
@override
String get retryLabel => 'Retry';
@@ -366,7 +366,7 @@ class StreamPhotoGallery extends StatelessWidget {
color: chatThemeData.colorTheme.disabled,
),
emptyTitle: Text(
context.translations.noUsersLabel,
context.translations.noPhotoOrVideoLabel,
style: chatThemeData.textTheme.headline,
),
),
@@ -377,7 +377,7 @@ class StreamPhotoGallery extends StatelessWidget {
return StreamScrollViewLoadMoreError.grid(
onTap: controller.retry,
error: Text(
context.translations.loadingUsersError,
context.translations.genericErrorText,
textAlign: TextAlign.center,
),
);
@@ -400,7 +400,7 @@ class StreamPhotoGallery extends StatelessWidget {
return errorBuilder?.call(context, error) ??
Center(
child: StreamScrollViewErrorWidget(
errorTitle: Text(context.translations.loadingUsersError),
errorTitle: Text(context.translations.genericErrorText),
onRetryPressed: controller.refresh,
),
);