@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
2
2
import 'package:flutter_bloc/flutter_bloc.dart' ;
3
3
import 'package:go_router/go_router.dart' ;
4
4
import 'package:ht_dashboard/dashboard/bloc/dashboard_bloc.dart' ;
5
- import 'package:ht_dashboard/l10n/app_localizations.dart' ;
6
5
import 'package:ht_dashboard/l10n/l10n.dart' ;
7
6
import 'package:ht_dashboard/router/routes.dart' ;
8
7
import 'package:ht_dashboard/shared/shared.dart' ;
@@ -50,10 +49,8 @@ class _DashboardPageState extends State<DashboardPage> {
50
49
);
51
50
}
52
51
if (state.status == DashboardStatus .success &&
53
- state.summary != null &&
54
- state.appConfig != null ) {
52
+ state.summary != null ) {
55
53
final summary = state.summary! ;
56
- final appConfig = state.appConfig! ;
57
54
final recentHeadlines = state.recentHeadlines;
58
55
return ListView (
59
56
padding: const EdgeInsets .all (AppSpacing .lg),
@@ -113,15 +110,7 @@ class _DashboardPageState extends State<DashboardPage> {
113
110
114
111
final mainContent = [
115
112
_RecentHeadlinesCard (headlines: recentHeadlines),
116
- Column (
117
- children: [
118
- _SystemStatusCard (
119
- appStatus: appConfig.appStatus,
120
- ),
121
- const SizedBox (height: AppSpacing .lg),
122
- const _QuickActionsCard (),
123
- ],
124
- ),
113
+ const _QuickActionsCard (),
125
114
];
126
115
127
116
if (isWide) {
@@ -155,71 +144,6 @@ class _DashboardPageState extends State<DashboardPage> {
155
144
}
156
145
}
157
146
158
- /// A card to display the current operational status of the application.
159
- class _SystemStatusCard extends StatelessWidget {
160
- const _SystemStatusCard ({required this .appStatus});
161
-
162
- final AppStatus appStatus;
163
-
164
- @override
165
- Widget build (BuildContext context) {
166
- final l10n = context.l10n;
167
- final theme = Theme .of (context);
168
-
169
- final (icon, color, text) = _getStatusDetails (appStatus, l10n, theme);
170
-
171
- return Card (
172
- child: Padding (
173
- padding: const EdgeInsets .all (AppSpacing .lg),
174
- child: Column (
175
- crossAxisAlignment: CrossAxisAlignment .start,
176
- children: [
177
- Text (l10n.systemStatus, style: theme.textTheme.titleLarge),
178
- const SizedBox (height: AppSpacing .md),
179
- Row (
180
- children: [
181
- Icon (icon, color: color, size: 24 ),
182
- const SizedBox (width: AppSpacing .sm),
183
- Text (
184
- text,
185
- style: theme.textTheme.titleMedium? .copyWith (color: color),
186
- ),
187
- ],
188
- ),
189
- ],
190
- ),
191
- ),
192
- );
193
- }
194
-
195
- /// Returns the appropriate icon, color, and text for a given status.
196
- (IconData , Color , String ) _getStatusDetails (
197
- AppStatus appStatus,
198
- AppLocalizations l10n,
199
- ThemeData theme,
200
- ) {
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
- );
219
- }
220
- }
221
- }
222
-
223
147
/// A card providing quick navigation to common administrative tasks.
224
148
class _QuickActionsCard extends StatelessWidget {
225
149
const _QuickActionsCard ();
0 commit comments