|
1 | 1 | import 'package:auto_size_text/auto_size_text.dart'; |
2 | | -import 'package:cached_network_image/cached_network_image.dart'; |
3 | 2 | import 'package:flutter/material.dart'; |
4 | 3 | import 'package:piwigo_ng/components/app_image_display.dart'; |
5 | 4 | import 'package:piwigo_ng/models/image_model.dart'; |
@@ -106,32 +105,6 @@ class ImageCard extends StatelessWidget { |
106 | 105 | return ImageNetworkDisplay( |
107 | 106 | imageUrl: imageUrl, |
108 | 107 | ); |
109 | | - return CachedNetworkImage( |
110 | | - imageUrl: imageUrl ?? '', |
111 | | - fadeInDuration: const Duration(milliseconds: 300), |
112 | | - imageBuilder: (context, provider) => Image( |
113 | | - image: provider, |
114 | | - fit: BoxFit.cover, |
115 | | - errorBuilder: (context, o, s) { |
116 | | - debugPrint("$o\n$s"); |
117 | | - return _buildErrorWidget(context); |
118 | | - }, |
119 | | - ), |
120 | | - progressIndicatorBuilder: (context, url, download) { |
121 | | - if (download.downloaded >= (download.totalSize ?? 0)) { |
122 | | - return const SizedBox(); |
123 | | - } |
124 | | - return Center( |
125 | | - child: CircularProgressIndicator( |
126 | | - value: download.progress, |
127 | | - ), |
128 | | - ); |
129 | | - }, |
130 | | - errorWidget: (context, url, error) { |
131 | | - debugPrint("[$url] $error"); |
132 | | - return _buildErrorWidget(context); |
133 | | - }, |
134 | | - ); |
135 | 108 | } |
136 | 109 |
|
137 | 110 | List<Widget> _buildSelectOverlay(context) { |
@@ -185,17 +158,4 @@ class ImageCard extends StatelessWidget { |
185 | 158 | ), |
186 | 159 | ]; |
187 | 160 | } |
188 | | - |
189 | | - Widget _buildErrorWidget(BuildContext context) { |
190 | | - return FittedBox( |
191 | | - fit: BoxFit.cover, |
192 | | - child: Container( |
193 | | - padding: const EdgeInsets.all(16.0), |
194 | | - decoration: BoxDecoration( |
195 | | - color: Theme.of(context).scaffoldBackgroundColor, |
196 | | - ), |
197 | | - child: const Icon(Icons.broken_image_outlined), |
198 | | - ), |
199 | | - ); |
200 | | - } |
201 | 161 | } |
0 commit comments