@@ -65,14 +65,14 @@ class _DashboardPageState extends State<DashboardPage> {
65
65
66
66
final summaryCards = [
67
67
_SummaryCard (
68
- icon: Icons .article_outlined ,
69
- title: l10n.totalHeadlines ,
70
- value: summary.headlineCount .toString (),
68
+ icon: Icons .category_outlined ,
69
+ title: l10n.totalTopics ,
70
+ value: summary.topicCount .toString (),
71
71
),
72
72
_SummaryCard (
73
73
icon: Icons .category_outlined,
74
- title: l10n.totalCategories ,
75
- value: summary.categoryCount .toString (),
74
+ title: l10n.totalTopics ,
75
+ value: summary.topicCount .toString (),
76
76
),
77
77
_SummaryCard (
78
78
icon: Icons .source_outlined,
@@ -116,7 +116,7 @@ class _DashboardPageState extends State<DashboardPage> {
116
116
Column (
117
117
children: [
118
118
_SystemStatusCard (
119
- status : appConfig.appOperationalStatus ,
119
+ appStatus : appConfig.appStatus ,
120
120
),
121
121
const SizedBox (height: AppSpacing .lg),
122
122
const _QuickActionsCard (),
@@ -157,16 +157,16 @@ class _DashboardPageState extends State<DashboardPage> {
157
157
158
158
/// A card to display the current operational status of the application.
159
159
class _SystemStatusCard extends StatelessWidget {
160
- const _SystemStatusCard ({required this .status });
160
+ const _SystemStatusCard ({required this .appStatus });
161
161
162
- final RemoteAppStatus status ;
162
+ final AppStatus appStatus ;
163
163
164
164
@override
165
165
Widget build (BuildContext context) {
166
166
final l10n = context.l10n;
167
167
final theme = Theme .of (context);
168
168
169
- final (icon, color, text) = _getStatusDetails (status , l10n, theme);
169
+ final (icon, color, text) = _getStatusDetails (appStatus , l10n, theme);
170
170
171
171
return Card (
172
172
child: Padding (
@@ -194,29 +194,28 @@ class _SystemStatusCard extends StatelessWidget {
194
194
195
195
/// Returns the appropriate icon, color, and text for a given status.
196
196
(IconData , Color , String ) _getStatusDetails (
197
- RemoteAppStatus status ,
197
+ AppStatus appStatus ,
198
198
AppLocalizations l10n,
199
199
ThemeData theme,
200
200
) {
201
- switch (status) {
202
- case RemoteAppStatus .active:
203
- return (
204
- Icons .check_circle_outline,
205
- theme.colorScheme.primary,
206
- l10n.appStatusActive,
207
- );
208
- case RemoteAppStatus .maintenance:
209
- return (
210
- Icons .warning_amber_outlined,
211
- theme.colorScheme.tertiary,
212
- l10n.appStatusMaintenance,
213
- );
214
- case RemoteAppStatus .disabled:
215
- return (
216
- Icons .cancel_outlined,
217
- theme.colorScheme.error,
218
- l10n.appStatusDisabled,
219
- );
201
+ if (appStatus.isUnderMaintenance) {
202
+ return (
203
+ Icons .warning_amber_outlined,
204
+ theme.colorScheme.tertiary,
205
+ l10n.appStatusMaintenance,
206
+ );
207
+ } else if (appStatus.isLatestVersionOnly) {
208
+ return (
209
+ Icons .cancel_outlined,
210
+ theme.colorScheme.error,
211
+ l10n.appStatusDisabled,
212
+ );
213
+ } else {
214
+ return (
215
+ Icons .check_circle_outline,
216
+ theme.colorScheme.primary,
217
+ l10n.appStatusActive,
218
+ );
220
219
}
221
220
}
222
221
}
@@ -246,8 +245,8 @@ class _QuickActionsCard extends StatelessWidget {
246
245
const SizedBox (height: AppSpacing .sm),
247
246
OutlinedButton .icon (
248
247
icon: const Icon (Icons .create_new_folder_outlined),
249
- label: Text (l10n.createCategory ),
250
- onPressed: () => context.goNamed (Routes .createCategoryName ),
248
+ label: Text (l10n.createTopic ),
249
+ onPressed: () => context.goNamed (Routes .createTopicName ),
251
250
),
252
251
const SizedBox (height: AppSpacing .sm),
253
252
OutlinedButton .icon (
0 commit comments