@@ -268,45 +268,56 @@ class _HeadlineDetailsPageState extends State<HeadlineDetailsPage> {
268
268
child: Text (headline.title, style: textTheme.headlineMedium),
269
269
),
270
270
),
271
- if (headline.imageUrl != null )
272
- SliverPadding (
273
- padding: const EdgeInsets .only (
274
- top: AppSpacing .lg,
275
- left: AppSpacing .paddingLarge,
276
- right: AppSpacing .paddingLarge,
277
- ),
278
- sliver: SliverToBoxAdapter (
279
- child: ClipRRect (
280
- borderRadius: BorderRadius .circular (AppSpacing .md),
281
- child: Image .network (
282
- headline.imageUrl! ,
283
- width: double .infinity,
284
- height: 200 ,
285
- fit: BoxFit .cover,
286
- loadingBuilder: (context, child, loadingProgress) {
287
- if (loadingProgress == null ) return child;
288
- return Container (
271
+ // Image or Placeholder Section
272
+ SliverPadding (
273
+ padding: const EdgeInsets .only (
274
+ top: AppSpacing .lg,
275
+ left: AppSpacing .paddingLarge,
276
+ right: AppSpacing .paddingLarge,
277
+ ),
278
+ sliver: SliverToBoxAdapter (
279
+ child: ClipRRect (
280
+ borderRadius: BorderRadius .circular (AppSpacing .md),
281
+ child: headline.imageUrl != null
282
+ ? Image .network (
283
+ headline.imageUrl! ,
289
284
width: double .infinity,
290
285
height: 200 ,
291
- color: colorScheme.surfaceContainerHighest,
292
- child: const Center (child: CircularProgressIndicator ()),
293
- );
294
- },
295
- errorBuilder:
296
- (context, error, stackTrace) => Container (
286
+ fit: BoxFit .cover,
287
+ loadingBuilder: (context, child, loadingProgress) {
288
+ if (loadingProgress == null ) return child;
289
+ return Container (
290
+ width: double .infinity,
291
+ height: 200 ,
292
+ color: colorScheme.surfaceContainerHighest,
293
+ child:
294
+ const Center (child: CircularProgressIndicator ()),
295
+ );
296
+ },
297
+ errorBuilder: (context, error, stackTrace) => Container (
297
298
width: double .infinity,
298
299
height: 200 ,
299
300
color: colorScheme.surfaceContainerHighest,
300
301
child: Icon (
301
- Icons .broken_image ,
302
+ Icons .broken_image_outlined ,
302
303
color: colorScheme.onSurfaceVariant,
303
304
size: AppSpacing .xxl,
304
305
),
305
306
),
306
- ),
307
- ),
307
+ )
308
+ : Container (
309
+ width: double .infinity,
310
+ height: 200 ,
311
+ color: colorScheme.surfaceContainerHighest,
312
+ child: Icon (
313
+ Icons .image_not_supported_outlined,
314
+ color: colorScheme.onSurfaceVariant,
315
+ size: AppSpacing .xxl,
316
+ ),
317
+ ),
308
318
),
309
319
),
320
+ ),
310
321
SliverPadding (
311
322
padding: horizontalPadding.copyWith (top: AppSpacing .lg),
312
323
sliver: SliverToBoxAdapter (
0 commit comments