|
1 | 1 | import 'package:core/core.dart'; |
2 | 2 | import 'package:flutter/material.dart'; |
3 | | -import 'package:flutter_news_app_mobile_client_full_source_code/shared/widgets/feed_core/headline_metadata_row.dart'; |
| 3 | +import 'package:flutter_news_app_mobile_client_full_source_code/shared/widgets/feed_core/headline_source_row.dart'; |
4 | 4 | import 'package:flutter_news_app_mobile_client_full_source_code/shared/widgets/feed_core/headline_tap_handler.dart'; |
5 | 5 | import 'package:ui_kit/ui_kit.dart'; |
6 | 6 |
|
@@ -47,84 +47,79 @@ class HeadlineTileImageTop extends StatelessWidget { |
47 | 47 | child: Column( |
48 | 48 | crossAxisAlignment: CrossAxisAlignment.start, |
49 | 49 | children: [ |
| 50 | + Padding( |
| 51 | + padding: const EdgeInsets.fromLTRB( |
| 52 | + AppSpacing.md, |
| 53 | + AppSpacing.md, |
| 54 | + AppSpacing.md, |
| 55 | + AppSpacing.md, |
| 56 | + ), |
| 57 | + child: HeadlineSourceRow(headline: headline), |
| 58 | + ), |
50 | 59 | InkWell( |
51 | 60 | onTap: |
52 | 61 | onHeadlineTap ?? |
53 | 62 | () => HeadlineTapHandler.handleHeadlineTap(context, headline), |
54 | | - child: ClipRRect( |
55 | | - borderRadius: const BorderRadius.only( |
56 | | - topLeft: Radius.circular(AppSpacing.xs), |
57 | | - topRight: Radius.circular(AppSpacing.xs), |
58 | | - ), |
59 | | - child: Image.network( |
60 | | - headline.imageUrl, |
61 | | - width: double.infinity, |
62 | | - height: 180, |
63 | | - fit: BoxFit.cover, |
64 | | - loadingBuilder: (context, child, loadingProgress) { |
65 | | - if (loadingProgress == null) return child; |
66 | | - return Container( |
67 | | - width: double.infinity, |
68 | | - height: 180, |
69 | | - color: colorScheme.surfaceContainerHighest, |
70 | | - child: const Center( |
71 | | - child: CircularProgressIndicator(strokeWidth: 2), |
72 | | - ), |
73 | | - ); |
74 | | - }, |
75 | | - errorBuilder: (context, error, stackTrace) => Container( |
| 63 | + child: Image.network( |
| 64 | + headline.imageUrl, |
| 65 | + width: double.infinity, |
| 66 | + height: 180, |
| 67 | + fit: BoxFit.cover, |
| 68 | + loadingBuilder: (context, child, loadingProgress) { |
| 69 | + if (loadingProgress == null) return child; |
| 70 | + return Container( |
76 | 71 | width: double.infinity, |
77 | 72 | height: 180, |
78 | 73 | color: colorScheme.surfaceContainerHighest, |
79 | | - child: Icon( |
80 | | - Icons.broken_image_outlined, |
81 | | - color: colorScheme.onSurfaceVariant, |
82 | | - size: AppSpacing.xxl, |
| 74 | + child: const Center( |
| 75 | + child: CircularProgressIndicator(strokeWidth: 2), |
83 | 76 | ), |
| 77 | + ); |
| 78 | + }, |
| 79 | + errorBuilder: (context, error, stackTrace) => Container( |
| 80 | + width: double.infinity, |
| 81 | + height: 180, |
| 82 | + color: colorScheme.surfaceContainerHighest, |
| 83 | + child: Icon( |
| 84 | + Icons.broken_image_outlined, |
| 85 | + color: colorScheme.onSurfaceVariant, |
| 86 | + size: AppSpacing.xxl, |
84 | 87 | ), |
85 | 88 | ), |
86 | 89 | ), |
87 | 90 | ), |
88 | 91 | Padding( |
89 | | - padding: const EdgeInsets.all(AppSpacing.md), |
90 | | - child: Column( |
| 92 | + padding: const EdgeInsets.fromLTRB( |
| 93 | + AppSpacing.md, |
| 94 | + AppSpacing.md, |
| 95 | + AppSpacing.md, |
| 96 | + AppSpacing.md, |
| 97 | + ), |
| 98 | + child: Row( |
91 | 99 | crossAxisAlignment: CrossAxisAlignment.start, |
92 | 100 | children: [ |
93 | | - Row( |
94 | | - crossAxisAlignment: CrossAxisAlignment.start, |
95 | | - children: [ |
96 | | - Expanded( |
97 | | - child: InkWell( |
98 | | - onTap: |
99 | | - onHeadlineTap ?? |
100 | | - () => HeadlineTapHandler.handleHeadlineTap( |
| 101 | + Expanded( |
| 102 | + child: InkWell( |
| 103 | + onTap: |
| 104 | + onHeadlineTap ?? |
| 105 | + () => HeadlineTapHandler.handleHeadlineTap( |
101 | 106 | context, |
102 | 107 | headline, |
103 | 108 | ), |
104 | | - child: Text( |
105 | | - headline.title, |
106 | | - style: textTheme.titleMedium?.copyWith( |
107 | | - fontWeight: FontWeight.w500, |
108 | | - ), |
109 | | - maxLines: 3, |
110 | | - overflow: TextOverflow.ellipsis, |
111 | | - ), |
| 109 | + child: Text( |
| 110 | + headline.title, |
| 111 | + style: textTheme.titleMedium?.copyWith( |
| 112 | + fontWeight: FontWeight.w500, |
112 | 113 | ), |
| 114 | + maxLines: 2, |
| 115 | + overflow: TextOverflow.ellipsis, |
113 | 116 | ), |
114 | | - if (trailing != null) ...[ |
115 | | - const SizedBox(width: AppSpacing.sm), |
116 | | - trailing!, |
117 | | - ], |
118 | | - ], |
119 | | - ), |
120 | | - const SizedBox(height: AppSpacing.sm), |
121 | | - HeadlineMetadataRow( |
122 | | - headline: headline, |
123 | | - colorScheme: colorScheme, |
124 | | - textTheme: textTheme, |
125 | | - currentContextEntityType: currentContextEntityType, |
126 | | - currentContextEntityId: currentContextEntityId, |
| 117 | + ), |
127 | 118 | ), |
| 119 | + if (trailing != null) ...[ |
| 120 | + const SizedBox(width: AppSpacing.sm), |
| 121 | + trailing!, |
| 122 | + ], |
128 | 123 | ], |
129 | 124 | ), |
130 | 125 | ), |
|
0 commit comments