(2025 | Flutter, Dart, BLE, Provider, SharedPreferences, Syncfusion Gauges, Intl)
Links
- GitHub Repository: https://github.com/K3nny-k/SpeedMeter-Pro
Overview
Cross‑platform speedometer/odometer app that streams 10Hz BLE data from a vehicle sensor, provides a configurable gauge UI, and gracefully handles disconnects with auto‑reconnect and timeout reset to 0.
Development Process
Planning & Design
- Defined goals: real‑time readability (10Hz), robust reconnection, and minimal friction (auto permissions, instant language switch EN/ZH).
- Chose Provider for predictable state, SharedPreferences for persistent settings (units, max scale), and Syncfusion gauges for performant visuals.
Implementation
- Implemented BLE scan/connect/notify with
flutter_blue_plus; connection state machine + auto‑reconnect; 1s timeout resets speed to 0. - Designed a custom protocol for speed/odometer/modes/write‑odometer/device info; CRC divergence handling and fault tolerance to avoid UI jitter.
- Built a high‑performance speedometer (fixed 3‑digit layout, smooth transitions); enforced screen wakelock during connection.
Deployment & Optimization
- Smoothed stream updates for 60fps UI (throttle/debounce/merge); stabilized reconnect behavior and safe disconnect (speed reset, odometer retained).
- Structured logs and simulated data for end‑to‑end validation; guarded errors across BLE and parsing to prevent app‑wide failures.
Key Highlights
- Reliable 10Hz streaming with auto‑reconnect and timeout safeguards.
- Custom BLE protocol with defensive parsing and CRC handling.
- i18n (EN/ZH) + persisted settings for an ergonomic experience.