Skip to content

Commit

Permalink
Show also the dead link for debugging when loading image
Browse files Browse the repository at this point in the history
  • Loading branch information
ttdyce committed Dec 22, 2024
1 parent da5a15b commit 2ec8c4a
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1203,10 +1203,28 @@ class SimpleCachedNetworkImage extends StatelessWidget {
),
errorWidget: (context, url, error) => AspectRatio(
aspectRatio: width / height,
child: const Center(
child: Icon(
Icons.error,
color: Colors.red,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(
Icons.error,
color: Colors.red,
),
GestureDetector(
onTap: () {
Clipboard.setData(ClipboardData(text: url));
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Link copied to clipboard')),
);
},
child: Text(
"$url",
style: const TextStyle(
color: Colors.blue, decoration: TextDecoration.underline),
),
),
],
),
),
),
Expand Down

0 comments on commit 2ec8c4a

Please sign in to comment.