mirror of
https://github.com/IllusionMan1212/lyrics-grabbr.git
synced 2026-10-24 02:12:27 +00:00
fix: show toast error and fallback icon when album art fails to load
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
|
||||
import 'lyrics.dart';
|
||||
|
||||
@@ -135,6 +136,17 @@ class _SearchResultState extends State<SearchResult> {
|
||||
width: 75,
|
||||
height: 75,
|
||||
fit: BoxFit.cover,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
Fluttertoast.showToast(
|
||||
msg: 'Failed to load album art for: ${widget.title}',
|
||||
toastLength: Toast.LENGTH_LONG);
|
||||
return const Center(
|
||||
child: SizedBox(
|
||||
width: 75,
|
||||
height: 75,
|
||||
child: Icon(Icons.broken_image, size: 40)),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
|
||||
Reference in New Issue
Block a user