mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
avif: updated gallery widget to display message for non supported avif image type
This commit is contained in:
@@ -471,6 +471,10 @@
|
||||
},
|
||||
"gallery": "Galeria",
|
||||
"@gallery": {},
|
||||
"galleryAvifNotSupported": "AVIF no és compatible",
|
||||
"@galleryAvifNotSupported": {},
|
||||
"galleryAvifNotSupportedDetail": "Les imatges AVIF encara no són compatibles.",
|
||||
"@galleryAvifNotSupportedDetail": {},
|
||||
"addImage": "Afegeix imatge",
|
||||
"@addImage": {},
|
||||
"dataCopied": "Dades copiades a una nova entrada",
|
||||
|
||||
@@ -508,6 +508,10 @@
|
||||
"@takePicture": {},
|
||||
"gallery": "Galerie",
|
||||
"@gallery": {},
|
||||
"galleryAvifNotSupported": "AVIF není podporován",
|
||||
"@galleryAvifNotSupported": {},
|
||||
"galleryAvifNotSupportedDetail": "Obrazy AVIF zatím nejsou podporovány.",
|
||||
"@galleryAvifNotSupportedDetail": {},
|
||||
"productFound": "Produkt nalezen",
|
||||
"@productFound": {
|
||||
"description": "Header label for dialog when product is found with barcode"
|
||||
|
||||
@@ -357,6 +357,10 @@
|
||||
"@addImage": {},
|
||||
"gallery": "Galerie",
|
||||
"@gallery": {},
|
||||
"galleryAvifNotSupported": "AVIF wird nicht unterstützt",
|
||||
"@galleryAvifNotSupported": {},
|
||||
"galleryAvifNotSupportedDetail": "AVIF-Bilder werden noch nicht unterstützt.",
|
||||
"@galleryAvifNotSupportedDetail": {},
|
||||
"chooseFromLibrary": "Wähle aus der Bibliothek",
|
||||
"@chooseFromLibrary": {},
|
||||
"takePicture": "Bild aufnehmen",
|
||||
|
||||
@@ -680,6 +680,10 @@
|
||||
"@chooseFromLibrary": {},
|
||||
"gallery": "Gallery",
|
||||
"@gallery": {},
|
||||
"galleryAvifNotSupported": "AVIF not supported",
|
||||
"@galleryAvifNotSupported": {},
|
||||
"galleryAvifNotSupportedDetail": "AVIF images are not supported yet.",
|
||||
"@galleryAvifNotSupportedDetail": {},
|
||||
"addImage": "Add image",
|
||||
"@addImage": {},
|
||||
"dataCopied": "Data copied to new entry",
|
||||
@@ -1032,4 +1036,4 @@
|
||||
"darkMode": "Always dark mode",
|
||||
"lightMode": "Always light mode",
|
||||
"systemMode": "System settings"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,6 +344,10 @@
|
||||
"@addImage": {},
|
||||
"gallery": "Galería",
|
||||
"@gallery": {},
|
||||
"galleryAvifNotSupported": "AVIF no compatible",
|
||||
"@galleryAvifNotSupported": {},
|
||||
"galleryAvifNotSupportedDetail": "Las imágenes AVIF aún no son compatibles.",
|
||||
"@galleryAvifNotSupportedDetail": {},
|
||||
"chooseFromLibrary": "Elije de la biblioteca de fotos",
|
||||
"@chooseFromLibrary": {},
|
||||
"takePicture": "Toma una foto",
|
||||
|
||||
@@ -354,6 +354,10 @@
|
||||
"@addImage": {},
|
||||
"gallery": "Galerie",
|
||||
"@gallery": {},
|
||||
"galleryAvifNotSupported": "AVIF non pris en charge",
|
||||
"@galleryAvifNotSupported": {},
|
||||
"galleryAvifNotSupportedDetail": "AVIF non pris en charge",
|
||||
"@galleryAvifNotSupportedDetail": {},
|
||||
"chooseFromLibrary": "Choisir depuis la bibliothèque",
|
||||
"@chooseFromLibrary": {},
|
||||
"takePicture": "Prendre une photo",
|
||||
|
||||
@@ -473,6 +473,10 @@
|
||||
"@chooseFromLibrary": {},
|
||||
"gallery": "Gallery",
|
||||
"@gallery": {},
|
||||
"galleryAvifNotSupported": "AVIFはサポートされていません",
|
||||
"@galleryAvifNotSupported": {},
|
||||
"galleryAvifNotSupportedDetail": "AVIF形式の画像はまだサポートされていません。",
|
||||
"@galleryAvifNotSupportedDetail": {},
|
||||
"addImage": "Add image",
|
||||
"@addImage": {},
|
||||
"dataCopied": "Data copied to new entry",
|
||||
|
||||
@@ -479,6 +479,10 @@
|
||||
"@chooseFromLibrary": {},
|
||||
"gallery": "Галерея",
|
||||
"@gallery": {},
|
||||
"galleryAvifNotSupported": "AVIF не підтримується",
|
||||
"@galleryAvifNotSupported": {},
|
||||
"galleryAvifNotSupportedDetail": "Зображення AVIF поки що не підтримуються.",
|
||||
"@galleryAvifNotSupportedDetail": {},
|
||||
"addImage": "Додати зображення",
|
||||
"@addImage": {},
|
||||
"dataCopied": "Дані скопійовано до нового запису",
|
||||
|
||||
@@ -35,6 +35,7 @@ class Gallery extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final provider = Provider.of<GalleryProvider>(context);
|
||||
final i18n = AppLocalizations.of(context);
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(5),
|
||||
@@ -57,13 +58,20 @@ class Gallery extends StatelessWidget {
|
||||
context: context,
|
||||
);
|
||||
},
|
||||
child: FadeInImage(
|
||||
key: Key('image-${currentImage.id!}'),
|
||||
placeholder: const AssetImage('assets/images/placeholder.png'),
|
||||
image: NetworkImage(currentImage.url!),
|
||||
fit: BoxFit.cover,
|
||||
imageSemanticLabel: currentImage.description,
|
||||
),
|
||||
child: currentImage.url!.toLowerCase().endsWith('.avif')
|
||||
? AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: Center(
|
||||
child: Text(i18n.galleryAvifNotSupported),
|
||||
),
|
||||
)
|
||||
: FadeInImage(
|
||||
key: Key('image-${currentImage.id!}'),
|
||||
placeholder: const AssetImage('assets/images/placeholder.png'),
|
||||
image: NetworkImage(currentImage.url!),
|
||||
fit: BoxFit.cover,
|
||||
imageSemanticLabel: currentImage.description,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -82,6 +90,7 @@ class ImageDetail extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final i18n = AppLocalizations.of(context);
|
||||
return Container(
|
||||
key: Key('image-${image.id!}-detail'),
|
||||
padding: const EdgeInsets.all(10),
|
||||
@@ -92,7 +101,11 @@ class ImageDetail extends StatelessWidget {
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
),
|
||||
Expanded(
|
||||
child: Image.network(image.url!, semanticLabel: image.description),
|
||||
child: image.url!.toLowerCase().endsWith('.avif')
|
||||
? Center(
|
||||
child: Text(i18n.galleryAvifNotSupportedDetail),
|
||||
)
|
||||
: Image.network(image.url!, semanticLabel: image.description),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
|
||||
Reference in New Issue
Block a user