Skip to content

Commit

Permalink
More file extensions icon added in error icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham16g committed May 17, 2024
1 parent c8a0b7d commit b0f3359
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion example/lib/custom/initial_images_custom_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class _InitialImagesCustomExampleState
UniqueKey().toString(),
name: "test-image.jpg",
extension: "jpg",
path: "https://t.ly/F4XOS",
path: "https://cc-prod.scene7.com/is/image/CCProdAuthor/What-is-Stock-Photography_P1_mobile",
),
ImageFile(
UniqueKey().toString(),
Expand Down
26 changes: 19 additions & 7 deletions lib/src/image_file_view/error_preview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,26 @@ class ErrorPreview extends StatelessWidget {

IconData _getIcon() {
switch (imageFile.extension) {
case 'pdf':
return Icons.picture_as_pdf;
case 'png':
case 'jpg':
case 'jpeg':
case 'gif':
case 'webp':
case "png":
case "jpg":
case "jpeg":
case "svg":
case "webp":
return Icons.image;
case "pdf":
return Icons.picture_as_pdf;
case "mp4":
case "mkv":
case "wmv":
case "avi":
case "mov":
case "webm":
return Icons.play_circle;
case "mp3":
case "wav":
case "m4a":
case "ogg":
return Icons.music_note;
default:
return Icons.find_in_page_rounded;
}
Expand Down

0 comments on commit b0f3359

Please sign in to comment.