Conversation
This commit marks the completion of all features specified in the Product Requirements Document, including the hybrid engine, smart search, scam detector, comparison view, onboarding, settings, offline support, and accessibility features. It also includes architectural improvements, a full suite of automated tests, a critical bug fix for Firebase connectivity, and updated documentation.
…rst improvements BREAKING CHANGE: Remove Firebase dependencies in favor of offline-first architecture Architecture Changes: - Implement dependency injection using get_it and injectable - Add comprehensive error handling with custom failure types - Introduce repository pattern for data access abstraction - Remove Firebase Remote Config and caching services Localization & Internationalization: - Add full l10n support with flutter_localizations - Implement English and Tagalog translations - Add l10n configuration and ARB files - Update onboarding and all screens for localized content New Features: - Add TransportMode model for better type safety - Implement FareComparisonService for multi-route analysis - Add HaversineRoutingService as offline fallback - Add FareRepository for clean data layer separation Platform Updates: - Update Android build.gradle.kts with namespace configuration - Update iOS project configuration - Remove deprecated MainActivity.kt (moved to correct package) Documentation: - Add DESIGN_SYSTEM.md for UI/UX guidelines - Add comprehensive production readiness reports - Add security audit and stabilization reports - Add Firebase migration plan - Add startup analysis and investigation docs - Add architecture and project status reports Testing: - Update all test files to match refactored architecture - Add localization tests for onboarding flow - Add tests for new services (comparison, haversine routing) - Update mocks to support dependency injection Code Quality: - Remove unused Firebase integration code - Clean up deprecated service implementations - Improve code organization with feature-based structure - Enhance type safety throughout codebase Dependencies: - Remove firebase_core and firebase_remote_config - Add get_it, injectable, and flutter_localizations - Update pubspec.yaml with new architecture dependencies - Reduce overall dependency footprint (-75 lines in pubspec.lock) Stats: 31 files changed, 552 insertions(+), 627 deletions(-)
This commit resolves critical fare calculation issues and adds major feature enhancements to the PH Fare Estimator: **Bug Fixes:** - Fix formula loading crash caused by field name mismatch - Changed FareFormula.fromJson to read 'per_km' instead of 'per_km_rate' - Resolves "type 'Null' is not a subtype of type 'num'" error - Fixes "Formula not found" errors for Jeepney and Taxi **New Features:** - Implement OpenSource location feature using Geolocator + OSM Nominatim - Add "Use My Location" button to Origin field - Configure Android/iOS location permissions - Add location-related failure classes with error handling - NO API keys required - 100% free OpenSource solution **Data Expansion:** - Expand fare formulas from 8 to 25 transport modes - Add E-Jeepney, P2P Buses, Motorcycles, MRT/LRT/PNR, EDSA Carousel - Expand ferry routes from 3 to 46 (Luzon, Visayas, Mindanao, Palawan) - Expand train matrix from 6 to 196 station-to-station routes - Refactor ReferenceScreen to dynamically load from JSON assets **Technical Details:** - Added geolocator: ^13.0.2 dependency - Updated test mocks to support new interfaces - All changes pass flutter analyze with 0 errors - Added comprehensive documentation in workspace/ Files Changed: 20 modified, 9 new (+1,488/-195 lines)
Implement three major features for PH Fare Estimator: 1. User Discount System (20% for Student/Senior/PWD) - Add DiscountType enum model with fare multiplier logic - Update HybridEngine to apply discounts to all fare calculations - Add discount selection UI in Settings screen - Comply with PH laws: RA 11314, RA 9994, RA 7277 2. Transport Mode Filtering - Allow users to toggle specific modes/subtypes in Settings - Dynamically filter fare calculation results - Persist preferences via SettingsService - Support granular subtype filtering (e.g., Modern vs Traditional Jeepney) 3. Map-Based Destination Selection - Add full-screen MapPickerScreen with OpenStreetMap - Integrate map icons into origin/destination fields - Implement reverse geocoding via Nominatim API - Enable precise location selection with tap/drag Technical Changes: - New files: DiscountType model, MapPickerScreen, comprehensive test suite - Enhanced: HybridEngine, SettingsService, GeocodingService, MainScreen - Tests: 24 new automated tests (90% pass rate, no regressions) - Docs: Implementation plans, QA reports, manual verification checklist All features use open-source APIs (OSM, Nominatim) with no API keys required.
Implement comprehensive MVP features across 4 phases to enhance user experience and prepare the app for production release. Phase 1: Location & Map Intelligence - Add location persistence to SettingsService - Auto-fill origin field with last saved location on app restart - Constrain map view to Philippines boundaries (SW: 4.22°, 116.93° | NE: 21.32°, 126.61°) - Prevent global panning outside Philippine area - Add 3 new unit tests for location persistence Phase 2: Simplified Passenger Types & Onboarding - Consolidate 4 discount types into 2 categories (Regular, Discounted) - Unify Student/Senior/PWD under single 20% discount tier - Implement first-time user prompt for passenger type selection - Add migration logic for legacy discount type values - Update UI to display simplified passenger type options - Add hasSetDiscountType() tracking method Phase 3: Smart Fare Sorting & Value Indicators - Implement automatic fare sorting (cheapest to most expensive) - Add "BEST VALUE" badge with gold star icons to cheapest option - Enhance visual distinction for recommended fares - Add isRecommended field to FareResult model - Regenerate Hive adapters for model changes - Add 6 comprehensive unit tests for sorting logic Phase 4: Tourist-Friendly Documentation - Add discount information section to Reference screen - Include 20% discount details with legal references (RA 11314, RA 9994, RA 7277) - Add descriptive text for all 7 transport modes - Enhance Settings screen with educational content - Provide context-aware descriptions for tourists Test Results: - 54/61 tests passing (88.5% pass rate) - 100% core business logic tests passing (17/17) - 100% service layer tests passing (28/28) - 7 UI widget test failures (cosmetic, require text matcher updates) Files Changed: - Modified: 14 source/test files (+535, -138 lines) - Added: 8 documentation and test files - New test suite: test/features/fare_sorting_test.dart Breaking Changes: - DiscountType enum reduced from 4 to 2 values (migration logic included) - FareResult model updated with isRecommended field (backward compatible via Hive) Documentation: - Complete implementation reports for all 4 phases - Gap analysis and recommendations document - Final verification report with test results
Implement comprehensive Phase 5 enhancements including settings screen refactoring, critical crash fixes, enhanced filtering, and deduplication. Core Improvements: - Refactor settings screen with improved UX and modular architecture - Fix Hive storage crash issues affecting app stability - Enhance hybrid engine with advanced routing capabilities - Add transport mode display names and filtering improvements - Implement save route deduplication to prevent duplicates Feature Enhancements: - Extend fare comparison service with new filtering options - Add fare sorting capabilities by price and distance - Improve reference screen navigation and data display - Enhance main screen with better passenger type handling - Add comprehensive fare cache testing Testing & Quality: - Update all test suites for new functionality - Add fare_cache_service_test.dart with 116 new lines - Enhance mock helpers for better test coverage - Improve discount and filtering test scenarios Documentation: - Add data_model_updates_report.md - Add hive_crash_fix_report.md - Add phase5_final_verification_report.md - Add phase5_fixes_and_features_plan.md - Add reference_screen_fix_report.md - Add save_route_deduplication_implementation_report.md - Add settings_refactor_implementation_report.md - Update ui_integration_implementation_report.md Configuration: - Remove .env.example (no longer needed) Files Changed: 21 files (+1,293/-507)
This commit introduces Phase 6 enhancements with expanded Philippine
transport mode support, per-passenger fare calculation, and UX improvements.
## Data Layer Enhancements
- Add `is_per_head` field to all 24 fare formulas in fare_formulas.json
- Per-passenger fares (true): Jeepney, Bus, UV Express, Train, Ferry
- Per-vehicle fares (false): Taxi, Tricycle, Pedicab, Kuliglig
## Transport Mode Expansion
- Add 5 new TransportMode enum values: van, motorcycle, edsaCarousel,
pedicab, kuliglig
- Include proper category mapping, display names, and descriptions
- EDSA Carousel noted as free government-subsidized BRT service
## UI/UX Improvements
- Reference Screen: Convert flat lists to collapsible ExpansionTile
components for road transport and train sections
- Fare Result Card: Display passenger count ("X pax") for multi-passenger
trips with improved accessibility labels
- Main Screen: Traffic indicator now only applies to Taxi mode; all other
transport modes display standard (green) indicator
## Code Quality
- Normalize line endings (LF) across all Dart source files
- Apply consistent code formatting and trailing newlines
- Improve multi-line parameter handling for readability
## Test Updates
- Update test assertions for new passenger type dialog handling
- Align mock implementations with updated service signatures
- Fix test timing for autocomplete debounce behavior
## Documentation
- Add 5 new workspace reports: analysis_001_report, group_fare_report,
jeepney_fix_report, reference_ui_fix_report, traffic_color_fix_report
Files changed: 49 (44 modified, 5 new)
Lines: +936, -726
This commit completes a major MVP milestone including a full rebrand from "Fare Estimator" to "PH Fare Calculator" and introduces intelligent region-based transport mode filtering. ## App Rebranding - Renamed app from "Fare Estimator" to "PH Fare Calculator" across: - pubspec.yaml (package name: ph_fare_calculator) - AndroidManifest.xml (android:label) - iOS Info.plist (CFBundleDisplayName, CFBundleName) - All localization files (app_en.arb, app_tl.arb, generated l10n) - All Dart import statements (40+ files updated) ## Regional Transport Filtering System - Created RegionConfig model with static transport mode availability map - Implemented TransportModeFilterService with: - Bounding box region detection for NCR, Cebu, Davao, CDO - Latitude-based fallback for Luzon/Visayas/Mindanao - Transport mode validation per region - Regional restrictions based on Philippines transport research: - EDSA Carousel: NCR only (Metro Manila busway) - LRT/MRT/PNR Trains: NCR and Luzon only - Taxi: Major cities (NCR, Cebu, Davao, CDO) - Jeepney, Bus, Tricycle, Ferry: Nationwide ## Fare Comparison Service Enhancements - Injected TransportModeFilterService via dependency injection - Added regional filtering in compareFares() method - Implemented filterByRegion() for direct region-based filtering - Added groupFaresByMode() for UI grouping functionality ## UI Improvements - MainScreen now displays fare results grouped by transport mode - Each group has styled section headers with transport mode icons - Dynamic map adjustment when origin/destination selected ## Documentation - Created transport_availability_research.md with PH transport data - Created mvp_features_architecture.md with implementation plan - Updated mvp_final_verification_report.md with test results ## Testing - Added 24 new tests for TransportModeFilterService - Updated existing tests for new FareComparisonService signature - All 95 tests passing with zero static analysis issues Files Changed: 40 files (33 modified, 7 new) New Files: - lib/src/core/constants/region_constants.dart - lib/src/models/region_config.dart - lib/src/services/transport_mode_filter_service.dart - test/services/transport_mode_filter_service_test.dart - docs/workspace/mvp_features_architecture.md - docs/workspace/transport_availability_research.md
Three key MVP fixes implemented: Map Auto-Centering: - Destination map picker now falls back to origin location when destination is null, eliminating need to manually drag map Passenger Type Sync: - Settings discount type now syncs to main screen passenger state - Auto-applies discount when user is sole passenger with discount type - UI controls take precedence when multiple passengers added Transport Mode Parsing: - TransportMode.fromString() now handles "Mode (SubType)" format - Example: "Jeepney (Traditional)" correctly parses to Jeepney - Fixes fare results grouping by transport mode Additional changes: - Removed 49 obsolete documentation files - Added macos platform support files - Updated generated files and tests Verified: All 95 tests passing
MasuRii
added a commit
that referenced
this pull request
Mar 16, 2026
…r-fare-improvements feat: Complete PH Fare Calculator MVP with regional filtering and UX improvements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 PH Fare Calculator - Complete MVP Implementation
This pull request delivers the complete PH Fare Calculator MVP (Minimum Viable Product), transforming the initial skeleton into a fully-functional, production-ready Philippine public transport fare estimation application.
📋 Summary
This PR represents a major milestone with 15 commits, 141 files changed, and approximately +9,996/-3,833 lines of code. Key accomplishments include:
🔧 Changes by Category
🏗️ Architecture & Infrastructure
772716f582e450cbc391aKey Changes:
get_itandinjectableflutter_localizationswith English & Tagalog ARB files🚌 Transport Data & Models
0449091b9927dfNew Transport Modes Added:
Data Expansion:
Per-Passenger vs Per-Vehicle Logic:
🗺️ Regional Filtering System
114572dNew Files:
lib/src/core/constants/region_constants.dartlib/src/models/region_config.dartlib/src/services/transport_mode_filter_service.dartRegional Transport Availability:
👥 Passenger & Discount Features
6c8e19474164a9Discount System (Philippine Law Compliant):
Passenger Type Simplification:
🖥️ UI/UX Improvements
7f78350c0ed6d4bbe7beaKey UI Enhancements:
🔒 Security & Configuration
eaf8aecSecurity Improvements:
📁 Key Files Changed
New Core Files
lib/src/core/hybrid_engine.dartlib/src/core/di/injection.dartlib/src/repositories/fare_repository.dartlib/src/services/fare_comparison_service.dartlib/src/services/transport_mode_filter_service.dartNew UI Screens
lib/src/presentation/screens/main_screen.dartlib/src/presentation/screens/map_picker_screen.dartlib/src/presentation/screens/settings_screen.dartlib/src/presentation/screens/reference_screen.dartlib/src/presentation/screens/onboarding_screen.dartData Files
assets/data/fare_formulas.jsonassets/data/ferry_matrix.jsonassets/data/train_matrix.jsonRemoved
✅ Testing
Test Results: 95/95 PASSING (100%)
New Test Files:
test/services/transport_mode_filter_service_test.dart(24 tests)test/services/fare_comparison_service_test.darttest/services/hybrid_engine_test.darttest/features/fare_sorting_test.darttest/features/discount_and_filtering_test.dart🚀 How to Test
Prerequisites
Run All Tests
flutter testRun the App
Manual Testing Checklist
🔗 Related Issues
ph_fare_estimator→ph_fare_calculator📸 Screenshots
👥 Reviewers
Please review the following areas carefully:
HybridEngineTransportModeFilterServiceReady for Production 🎉