UI updates (#849)

* Updated dashboard

- Display "outstanding" badges
- Display "overdue" badges
- Pull-to-refresh

* Remove dead code

* Refactor app colors

* Add "pending shipments" icon

* Remove custom spinner

* Refactor error dialog

* Updated redirect after login

* Refactor login/account pages

- Better UX and confirmation messages

* Refactor API error messages

* Improve token management

- Secure storage
- Handle session expiry
- Per-profile HTTPS certificate checks

* Improved error messages
This commit is contained in:
Oliver
2026-07-06 21:10:10 +10:00
committed by GitHub
parent f737172180
commit 349a8e0ef5
45 changed files with 1240 additions and 477 deletions
+19 -14
View File
@@ -17,20 +17,25 @@ bool isDarkMode() {
return AdaptiveTheme.of(context).brightness == Brightness.dark;
}
// Return an "action" color based on the current theme
Color get COLOR_ACTION {
if (isDarkMode()) {
return Colors.lightBlueAccent;
} else {
return Colors.blue;
// Resolve the app's current ColorScheme, falling back to a sensible default
// if no BuildContext is available yet (e.g. very early app startup).
ColorScheme get _colorScheme {
final BuildContext? context = OneContext().context;
if (context == null) {
return const ColorScheme.light();
}
return Theme.of(context).colorScheme;
}
// Set to null to use the system default
Color? COLOR_APP_BAR;
const Color COLOR_WARNING = Color.fromRGBO(250, 150, 50, 1);
const Color COLOR_DANGER = Color.fromRGBO(200, 50, 75, 1);
const Color COLOR_SUCCESS = Color.fromRGBO(100, 200, 75, 1);
const Color COLOR_PROGRESS = Color.fromRGBO(50, 100, 200, 1);
const Color COLOR_GRAY_LIGHT = Color.fromRGBO(150, 150, 150, 1);
// Semantic colors, derived from the current theme's ColorScheme.
// Material 3 has no dedicated "success"/"warning" roles, so those map onto
// the nearest available accent (tertiary / secondary respectively).
Color get COLOR_ACTION => Colors.blue;
Color get COLOR_WARNING => Colors.orange;
Color get COLOR_DANGER => _colorScheme.error;
Color get COLOR_SUCCESS => Colors.lightGreen;
Color get COLOR_PROGRESS => Colors.lightBlue;
Color get COLOR_GRAY_LIGHT => _colorScheme.onSurfaceVariant;
Color get COLOR_TEXT => _colorScheme.onSurface;