feat: Add modern Flutter UI for FlatFinder app - #1
Conversation
Transform the leveling math library into a full Flutter application with: - Visual 2D bubble level with animations and glow effects - Dashboard showing pitch/roll readings with colored indicators - Adjustment cards with block stacking recommendations - Settings screen for vehicle type and dimensions - Calibration system for zeroing sensor offsets - Dark theme with glassmorphism design - Demo mode for testing without sensors - Provider-based state management - Support for trailers, vans, and motorhomes
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| _roll = _calibration.applyRoll(_rawRoll); | ||
|
|
||
| notifyListeners(); | ||
| } |
There was a problem hiding this comment.
Bug: Demo mode doesn't block real sensor updates causing race
When demo mode is enabled, the _updateFromAccelerometer method continues to receive and process sensor events without checking the _demoMode flag. This creates a race condition where both the demo timer (running every 50ms) and the real accelerometer subscription concurrently update _pitch, _roll, _rawPitch, and _rawRoll. The result is erratic, flickering values in the UI when demo mode is enabled on a device with working sensors, making the demo mode feature effectively broken.
Additional Locations (1)
| : 'Front Axle Leveling', | ||
| subtitle: provider.vehicleType == VehicleType.trailer | ||
| ? '${provider.pitch > 0 ? "Lower" : "Raise"} the hitch' | ||
| : 'Raise the ${provider.pitch > 0 ? "front" : "rear"} axle', |
There was a problem hiding this comment.
Bug: Van/motorhome subtitle gives inverted leveling direction
The van/motorhome adjustment subtitle has inverted logic. When pitch > 0 (nose up, front is higher), the subtitle says "Raise the front axle", but raising the already-high front would worsen the tilt. The correct instruction is to raise the rear axle to level the vehicle. Similarly, when pitch is negative (rear is higher), it incorrectly suggests raising the rear. The ternary condition provider.pitch > 0 ? "front" : "rear" has the values swapped.
Transform the leveling math library into a full Flutter application with:
Note
Transforms the project into the FlatFinder Flutter app with a sensor-driven leveling UI, settings, theming, and provider-based state management.
lib/features/level/screens/home_screen.dartwith animated bubble level (BubbleLevel), tilt cards, adjustment tabs, status banner, and quick actions.features/level/widgets/bubble_level.dart,tilt_card.dart,adjustment_card.dartwith block recommendations visualization.lib/core/theme/app_theme.dart.LevelProviderinlib/core/providers/level_provider.dartfor pitch/roll, demo mode, safety checks, block planning, and persistence viashared_preferences.features/level/math/leveling_math.dart) for side shim/hitch/fore-aft calculations and block planning.lib/features/settings/screens/settings_screen.dartto manage vehicle type, dimensions, safety threshold, and calibration.lib/main.dartto wire Provider and theme; lock portrait orientation.pubspec.yamlwith Flutter app metadata and deps (sensors_plus,shared_preferences,provider,google_fonts).analysis_options.yaml.README.mdwith app description, features, architecture, and setup.Written by Cursor Bugbot for commit 917d7c3. This will update automatically on new commits. Configure here.