|
@@ -59,12 +59,34 @@ class ImageViewerPage extends HookConsumerWidget {
|
|
|
imageUrl: imageUrl,
|
|
|
httpHeaders: {"Authorization": "Bearer ${box.get(accessTokenKey)}"},
|
|
|
fadeInDuration: const Duration(milliseconds: 250),
|
|
|
- errorWidget: (context, url, error) => const Icon(Icons.error),
|
|
|
+ errorWidget: (context, url, error) => ConstrainedBox(
|
|
|
+ constraints: const BoxConstraints(maxWidth: 300),
|
|
|
+ child: Wrap(
|
|
|
+ spacing: 32,
|
|
|
+ runSpacing: 32,
|
|
|
+ alignment: WrapAlignment.center,
|
|
|
+ children: [
|
|
|
+ const Text(
|
|
|
+ "Failed To Render Image - Possibly Corrupted Data",
|
|
|
+ textAlign: TextAlign.center,
|
|
|
+ style: TextStyle(fontSize: 16, color: Colors.white),
|
|
|
+ ),
|
|
|
+ SingleChildScrollView(
|
|
|
+ child: Text(
|
|
|
+ error.toString(),
|
|
|
+ textAlign: TextAlign.center,
|
|
|
+ style: TextStyle(fontSize: 12, color: Colors.grey[400]),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
// imageBuilder: (context, imageProvider) {
|
|
|
// return PhotoView(imageProvider: imageProvider);
|
|
|
// },
|
|
|
placeholder: (context, url) {
|
|
|
return CachedNetworkImage(
|
|
|
+ cacheKey: thumbnailUrl,
|
|
|
fit: BoxFit.cover,
|
|
|
imageUrl: thumbnailUrl,
|
|
|
httpHeaders: {"Authorization": "Bearer ${box.get(accessTokenKey)}"},
|
|
@@ -73,7 +95,10 @@ class ImageViewerPage extends HookConsumerWidget {
|
|
|
scale: 0.2,
|
|
|
child: CircularProgressIndicator(value: downloadProgress.progress),
|
|
|
),
|
|
|
- errorWidget: (context, url, error) => const Icon(Icons.error),
|
|
|
+ errorWidget: (context, url, error) => Icon(
|
|
|
+ Icons.error,
|
|
|
+ color: Colors.grey[300],
|
|
|
+ ),
|
|
|
);
|
|
|
},
|
|
|
),
|