|
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/l10n/l10n.dart'; |
3 | 4 | import 'package:flutter_news_app_mobile_client_full_source_code/shared/widgets/feed_core/headline_source_row.dart'; |
4 | 5 | import 'package:flutter_news_app_mobile_client_full_source_code/shared/widgets/feed_core/headline_tap_handler.dart'; |
5 | 6 | import 'package:ui_kit/ui_kit.dart'; |
@@ -38,6 +39,7 @@ class HeadlineTileImageTop extends StatelessWidget { |
38 | 39 | final theme = Theme.of(context); |
39 | 40 | final textTheme = theme.textTheme; |
40 | 41 | final colorScheme = theme.colorScheme; |
| 42 | + final l10n = AppLocalizationsX(context).l10n; |
41 | 43 |
|
42 | 44 | return Card( |
43 | 45 | margin: const EdgeInsets.symmetric( |
@@ -106,12 +108,24 @@ class HeadlineTileImageTop extends StatelessWidget { |
106 | 108 | context, |
107 | 109 | headline, |
108 | 110 | ), |
109 | | - child: Text( |
110 | | - headline.title, |
| 111 | + child: Text.rich( |
| 112 | + TextSpan( |
| 113 | + children: [ |
| 114 | + if (headline.isBreaking) |
| 115 | + TextSpan( |
| 116 | + text: '${l10n.breakingNewsPrefix} - ', |
| 117 | + style: textTheme.titleMedium?.copyWith( |
| 118 | + fontWeight: FontWeight.w600, |
| 119 | + color: colorScheme.primary, |
| 120 | + ), |
| 121 | + ), |
| 122 | + TextSpan(text: headline.title), |
| 123 | + ], |
| 124 | + ), |
111 | 125 | style: textTheme.titleMedium?.copyWith( |
112 | 126 | fontWeight: FontWeight.w500, |
113 | 127 | ), |
114 | | - maxLines: 2, |
| 128 | + maxLines: 3, |
115 | 129 | overflow: TextOverflow.ellipsis, |
116 | 130 | ), |
117 | 131 | ), |
|
0 commit comments