-
-
Notifications
You must be signed in to change notification settings - Fork 345
AVIF: updated gallery widget to display message for non supported avif image type #952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
lib/widgets/gallery/overview.dart
Outdated
| child: Text(i18n.galleryAvifNotSupported), | ||
| ), | ||
| ) | ||
| : FadeInImage( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I guess it wasn't very clear. If the OS supports avif, this will work just fine (e.g. in newer androids, no idea about ios or flathub), we just can't be sure.
we could do something like this
imageErrorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) {
return Container(
color: theme.colorScheme.errorContainer,
child: ... //show some general error message (add a Icons.broken_image somewhere?)
);
},There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I guess I misunderstood, thanks for the clarifications!
currently fixed
lib/l10n/app_ca.arb
Outdated
| }, | ||
| "gallery": "Galeria", | ||
| "@gallery": {}, | ||
| "galleryAvifNotSupported": "AVIF no és compatible", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and you even added translations! ❤️
(small nitpick, since this will apply to the exercises as well, call the translation key something more general like "imageFormatNotSupported" or so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's makes more sense, agreed.
Updated translations for more generic message as well as the naming
… types + translations
|
@rolandgeider please review new changes. Right now how it looks like: |
| spacing: 8, | ||
| children: [ | ||
| Icon(Icons.broken_image), | ||
| Text(i18n.imageFormatNotSupportedDetail(imageFormat)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it even displays the type dynamically, nice!
|
🚀 |

Changes Made
Currently we don't allow avif images to be uploaded, even if nothing speaks against it since all mayor browsers support it.
Done:
check if this works on the flutter app, since flutter itself doesn't support it and relies on the underlying OS. If not, gracefully handle this and display an error message to the user
update any i18n strings in the react or flutter app
Related Issue(s)
#2082
Demo Screenshots
Please check that the PR fulfills these requirements
(run
dart format .)///).