Skip to content

Commit 506bd5a

Browse files
committed
feat(ui): complete UI/UX overhaul with Material 3 design
Comprehensive redesign of all 8 screens and 2 shared widgets following modern Material 3 design standards with a Philippine Jeepney-inspired color palette (Blue #0038A8, Yellow #FCD116, Red #CE1126). ## Screens Redesigned (8) - **SplashScreen**: Animated logo, gradient background, pulsing loader - **OnboardingScreen**: 4-page flow, animated illustrations, progress dots - **MainScreen**: Modal bottom sheet for passengers, floating action buttons - **MapPickerScreen**: Draggable bottom sheet, animated location pins - **SavedRoutesScreen**: Swipe-to-delete, empty states, stagger animations - **SettingsScreen**: Grouped sections, toggle switches, themed cards - **ReferenceScreen**: 4 tabs (Road/Train/Ferry/Discounts), data tables - **OfflineMenuScreen**: Feature cards with icons, gradient header ## Widgets Improved (2) - **FareResultCard**: "Best Value" badge, status bars, colored icon containers - **MapSelectionWidget**: Animated markers, loading/error overlays, FABs ## New Files Created - `lib/src/core/theme/app_theme.dart` - Centralized theme definition - `docs/UIUX_DESIGN_SPEC.md` - Comprehensive design system guide - `docs/THEME_SPEC.md` - Theme implementation details - `docs/CURRENT_UI_ANALYSIS.md` - Initial UI audit report ## Key Improvements - Adopted `useMaterial3: true` globally - Stadium-shaped buttons (FilledButton, OutlinedButton) - 16dp rounded cards with elevated surfaces - Smooth animations (300-500ms duration curves) - Proper touch targets (minimum 48x48dp) - Responsive spacing (8dp base grid) - Enhanced accessibility with semantic labels ## Statistics - 26 files changed - 7,260 insertions(+), 1,709 deletions(-) - All 95 tests passing
1 parent 0d2fe62 commit 506bd5a

26 files changed

Lines changed: 7260 additions & 1709 deletions

docs/CURRENT_UI_ANALYSIS.md

Lines changed: 264 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,264 @@
1+
# Current UI/UX Analysis Report
2+
3+
## Executive Summary
4+
This report documents the current state of the User Interface and User Experience of the PH Fare Calculator application. The application utilizes a standard Material Design 3 theme with support for both light and dark modes (via high contrast setting). The current UI is functional but relies heavily on basic Material widgets (`Card`, `ListTile`, `ElevatedButton`) with minimal custom styling or branding. UX patterns are generally consistent, though some areas like the "passenger count" selection and "map picker" flow could be streamlined. Accessibility is partially implemented with `Semantics` widgets in critical areas.
5+
6+
## Global Theme & Configuration
7+
8+
### Dependencies (`pubspec.yaml`)
9+
- **UI Framework:** Flutter SDK
10+
- **Icons:** `cupertino_icons` (iOS style), Material Icons (default)
11+
- **Map:** `flutter_map` ^8.2.2, `latlong2` ^0.9.1
12+
- **Localization:** `flutter_localizations`, `intl`
13+
- **State/Storage:** `hive_flutter`, `shared_preferences`, `provider` (implied via `flutter_bloc` or similar, though strictly `ValueListenableBuilder` is used in `main.dart`)
14+
15+
### Theme Settings (`lib/main.dart`)
16+
- **Design System:** Material 3 (`useMaterial3: true`)
17+
- **Light Theme:**
18+
- Seed Color: `Colors.deepPurple`
19+
- **Dark Theme (High Contrast):**
20+
- Brightness: `Brightness.dark`
21+
- Background: `Colors.black`
22+
- Primary: `Colors.cyanAccent`
23+
- Secondary: `Colors.yellowAccent`
24+
- Surface: `Colors.black`
25+
- Error: `Colors.redAccent`
26+
- **Custom Typography:** `bodyMedium` (White, Bold), `titleLarge` (CyanAccent, Bold)
27+
- **Input Decoration:** White borders (enabled), CyanAccent borders (focused)
28+
- **Card Theme:** Black color, White border (2.0 width), Rounded corners (12.0)
29+
30+
---
31+
32+
## Screen Analysis
33+
34+
### 1. Main Screen (`lib/src/presentation/screens/main_screen.dart`)
35+
**Role:** The primary dashboard for route entry, map visualization, and fare calculation.
36+
37+
- **Visual Structure:**
38+
- `AppBar` with title and actions (Offline Reference, Settings).
39+
- `SingleChildScrollView` body containing a vertical column of form elements.
40+
- Two `Autocomplete<Location>` fields for Origin and Destination.
41+
- A custom `Passenger Count Selector` card.
42+
- A `MapSelectionWidget` (height: 300) showing the route.
43+
- A "Calculate Fare" `ElevatedButton`.
44+
- Results section with a "Save Route" button, Sort Dropdown, and a list of grouped `FareResultCard`s.
45+
46+
- **Styling:**
47+
- Standard Material padding (16.0).
48+
- Use of `Card` elevation for grouping inputs.
49+
- Results are grouped by transport mode with colored headers (`primaryContainer`).
50+
51+
- **UX Patterns:**
52+
- **Input:** Autocomplete text fields with debouncing (800ms).
53+
- **Feedback:** Loading spinners inside text fields. Error messages displayed as red text or Snackbars.
54+
- **Navigation:** Modal routes for Map Picker and Settings.
55+
56+
- **Issues / Improvement Areas:**
57+
- The map widget has a fixed height of 300, which might be cramped on larger screens or too large on small ones.
58+
- The "Passenger Count" selector opens a complex dialog; a bottom sheet might be more modern.
59+
- The "Calculate Fare" button is disabled until valid inputs are present, which is good practice but could use better visual cues for *why* it is disabled.
60+
61+
- **Accessibility:**
62+
- `Semantics` used for AppBar actions ("Open offline reference menu", "Open settings").
63+
- `Semantics` wrapper around the "Calculate Fare" button.
64+
- `Semantics` on text fields.
65+
66+
### 2. Map Picker Screen (`lib/src/presentation/screens/map_picker_screen.dart`)
67+
**Role:** Full-screen map interface for selecting a location coordinate.
68+
69+
- **Visual Structure:**
70+
- `AppBar` with "Confirm" text button action.
71+
- Full-screen `FlutterMap`.
72+
- Fixed center crosshair icon (`Icons.add`).
73+
- Floating instructions card at the top.
74+
- `FloatingActionButton` to confirm selection (appears only when location selected).
75+
76+
- **Styling:**
77+
- Minimalist. Relies mostly on the map tiles.
78+
- Top instruction card uses standard Card styling.
79+
80+
- **UX Patterns:**
81+
- **Interaction:** Tap to select, or drag map to center.
82+
- **Feedback:** A marker appears where tapped. The center crosshair implies "target" selection mode.
83+
84+
- **Issues / Improvement Areas:**
85+
- The coexistence of "Tap to select" and "Center crosshair" can be confusing. Usually, it's one or the other (pin drags with map vs. tap to drop pin).
86+
- The top instruction card obscures map content.
87+
88+
- **Accessibility:**
89+
- No specific semantic labels documented for map interactions.
90+
91+
### 3. Offline Menu Screen (`lib/src/presentation/screens/offline_menu_screen.dart`)
92+
**Role:** Simple navigation menu for offline features.
93+
94+
- **Visual Structure:**
95+
- `AppBar`.
96+
- `ListView` with `Card` widgets acting as menu items.
97+
98+
- **Styling:**
99+
- Large icons (size 40.0) in primary color.
100+
- Bold titles and body text descriptions.
101+
- `Chevron` right icon to indicate navigation.
102+
103+
- **UX Patterns:**
104+
- Standard list navigation pattern.
105+
106+
- **Issues / Improvement Areas:**
107+
- Very sparse. Could be a section in a drawer or a bottom tab instead of a separate screen.
108+
109+
- **Accessibility:**
110+
- Standard flutter widget accessibility.
111+
112+
### 4. Onboarding Screen (`lib/src/presentation/screens/onboarding_screen.dart`)
113+
**Role:** Initial setup for language selection and welcome message.
114+
115+
- **Visual Structure:**
116+
- `Column` layout with `Spacer`s for vertical centering.
117+
- Welcome text, Language selection buttons (English/Tagalog), Disclaimer, and "Continue" button.
118+
119+
- **Styling:**
120+
- Large bold welcome text (24sp).
121+
- Language buttons use `FilledButton` (selected) vs `OutlinedButton` (unselected).
122+
123+
- **UX Patterns:**
124+
- **State:** Updates locale immediately via `SettingsService`.
125+
- **Navigation:** Replaces route with `MainScreen` upon completion.
126+
127+
- **Issues / Improvement Areas:**
128+
- Basic layout. No illustrations or carousel to explain app features.
129+
130+
- **Accessibility:**
131+
- `Semantics` applied to language buttons and the continue button.
132+
133+
### 5. Reference Screen (`lib/src/presentation/screens/reference_screen.dart`)
134+
**Role:** Static informational screen showing fare tables and matrices.
135+
136+
- **Visual Structure:**
137+
- `ListView` containing multiple sections: Discount Info, Road Transport, Train, Ferry.
138+
- Uses `ExpansionTile` within `Card`s to organize large datasets.
139+
140+
- **Styling:**
141+
- Color-coded sections (Blue for discounts, Amber for warnings).
142+
- Dense lists for fare matrices.
143+
144+
- **UX Patterns:**
145+
- **Loading:** Shows `CircularProgressIndicator` while parsing JSON assets.
146+
- **Organization:** Collapsible sections (`ExpansionTile`) keep the view clean.
147+
148+
- **Issues / Improvement Areas:**
149+
- Text heavy.
150+
- The "Train Matrix" list can be very long; search or filter functionality would be beneficial.
151+
152+
- **Accessibility:**
153+
- Standard scrolling and tap targets.
154+
155+
### 6. Saved Routes Screen (`lib/src/presentation/screens/saved_routes_screen.dart`)
156+
**Role:** Lists routes previously saved by the user.
157+
158+
- **Visual Structure:**
159+
- `ListView` of `Card` widgets.
160+
- Each card contains an `ExpansionTile` showing summary (Origin -> Dest) and detailed `FareResultCard`s when expanded.
161+
- Delete icon button in the trailing position.
162+
163+
- **Styling:**
164+
- Standard Card styling.
165+
- Date formatting using `intl`.
166+
167+
- **UX Patterns:**
168+
- **Empty State:** Simple text "No saved routes yet."
169+
- **Action:** Delete button removes item immediately (no undo mentioned in code).
170+
171+
- **Issues / Improvement Areas:**
172+
- No "Undo" action for deletion.
173+
- No way to "Re-calculate" or "Load" a saved route back into the Main Screen for updated pricing.
174+
175+
- **Accessibility:**
176+
- Standard controls.
177+
178+
### 7. Settings Screen (`lib/src/presentation/screens/settings_screen.dart`)
179+
**Role:** Configuration for app behavior and preferences.
180+
181+
- **Visual Structure:**
182+
- `ListView` with `SwitchListTile` and `RadioListTile` widgets.
183+
- Sections: General (Provincial, High Contrast), Traffic Factor, Passenger Type, Transport Modes.
184+
185+
- **Styling:**
186+
- Standard Material settings list styling.
187+
- "Transport Modes" section dynamically generates cards with toggles for each sub-type.
188+
189+
- **UX Patterns:**
190+
- **Immediate Action:** Toggles and selections save immediately to `SettingsService`.
191+
192+
- **Issues / Improvement Areas:**
193+
- The "Transport Modes" list can get very long.
194+
- "Traffic Factor" radio buttons take up a lot of vertical space.
195+
196+
- **Accessibility:**
197+
- Standard form controls are generally accessible.
198+
199+
### 8. Splash Screen (`lib/src/presentation/screens/splash_screen.dart`)
200+
**Role:** Bootstrapping logic (DI, DB, Seeding) before navigating to app.
201+
202+
- **Visual Structure:**
203+
- Simple `Scaffold` with a centered `FlutterLogo` (size 100).
204+
- Error state shows a red error icon and text if initialization fails.
205+
206+
- **Styling:**
207+
- Minimal.
208+
209+
- **UX Patterns:**
210+
- **Wait:** Forces a minimum 2-second delay even if loading is faster.
211+
- **Routing:** Decides between Onboarding vs Main Screen based on SharedPrefs.
212+
213+
- **Issues / Improvement Areas:**
214+
- Static logo. Could use an animated branding element.
215+
- No progress indicator during the "loading" phase (just logo).
216+
217+
- **Accessibility:**
218+
- Not interactive, essentially an image.
219+
220+
---
221+
222+
## Widget Analysis
223+
224+
### 1. Fare Result Card (`lib/src/presentation/widgets/fare_result_card.dart`)
225+
**Role:** Displays a single fare calculation result.
226+
227+
- **Visual Structure:**
228+
- `Card` with colored border.
229+
- Column content: "BEST VALUE" badge (optional), Transport Mode Name, Price (Headline style), Passenger count.
230+
- **Styling:**
231+
- Border color maps to `IndicatorLevel` (Green/Amber/Red).
232+
- "Recommended" items have thicker borders and a star icon.
233+
- Background is a low-opacity version of the status color.
234+
- **Accessibility:**
235+
- **Excellent:** Uses a comprehensive `Semantics` label summarizing the entire card's content ("Fare estimate for X is Y...").
236+
237+
### 2. Map Selection Widget (`lib/src/presentation/widgets/map_selection_widget.dart`)
238+
**Role:** Embedded map view in the Main Screen.
239+
240+
- **Visual Structure:**
241+
- `FlutterMap` with OpenStreetMap tiles.
242+
- Markers for Origin (Green) and Destination (Red).
243+
- Polyline for the route (Blue, width 4.0).
244+
- Floating "Clear Selection" button (bottom right).
245+
- **Styling:**
246+
- Map takes full container space.
247+
- Standard marker icons.
248+
- **UX Patterns:**
249+
- Camera automatically fits bounds of Origin/Destination.
250+
- Tap interaction allows selecting points directly on this widget too.
251+
252+
---
253+
254+
## Conclusion
255+
The application currently adheres to a functional, "engineering-first" design approach. It uses standard Flutter Material widgets efficiently but lacks a distinct visual identity or "delight" factors.
256+
257+
**Key Improvement Opportunities:**
258+
1. **Visual Polish:** Move away from default Colors.blue/deepPurple to a custom color palette that reflects the "Filipino Commute" identity (perhaps jeepney-inspired colors).
259+
2. **Navigation:** Consider a BottomNavigationBar for switching between Calculator, Saved, and Reference screens instead of burying them in the AppBar.
260+
3. **Map Experience:** The map picker and embedded map could be unified or made more interactive with better transitions.
261+
4. **Feedback:** Add more micro-interactions (animations when fare is calculated, better loading states).
262+
5. **Typography:** The current typography is standard. Using a more modern font stack could improve readability.
263+
264+
This analysis serves as the baseline for the upcoming UI/UX redesign tasks.

0 commit comments

Comments
 (0)