A modern Flutter application that displays altitude information from multiple sensors and allows exploring elevations on an interactive world map.
Yep, this is AI generated (Claude Opus 4.5). For such a simple app, was the simplest way. So, keep this in mind, this app might have bugs, i just tested it once by myself, but it seems to work.
- GPS Altitude: Satellite-based elevation reading
- Barometer: Atmospheric pressure-based altitude (where hardware is available)
- Elevation API: Terrain elevation data from Open Topo Data
- OpenStreetMap-based tile rendering
- Real-time location tracking
- Tap anywhere to see elevation at that point
- Elevation comparison showing height difference from your current position
- Individual sensor readings with accuracy indicators
- Reliability status for each data source
- Conversion between meters and feet
- Last update timestamps
| Map View | Height Details | Elevation Comparison |
|---|---|---|
| Main map with location marker | All sensor readings | Selected point info |
This app follows a clean architecture pattern with clear separation of concerns:
lib/
βββ core/ # Core utilities and configuration
β βββ constants/ # App-wide constants
β βββ di/ # Dependency injection (GetIt)
β βββ extensions/ # Dart extensions
β βββ router/ # Navigation (go_router)
β βββ theme/ # App theming
β βββ utils/ # Utilities (Result, Failure)
βββ data/ # Data layer
β βββ datasources/ # Data sources (sensors, API)
β βββ models/ # Data models
β βββ repositories/ # Repository implementations
βββ presentation/ # Presentation layer
βββ blocs/ # BLoC state management
β βββ height/ # Height/altitude BLoC
β βββ location/ # Location tracking BLoC
β βββ map/ # Map interactions BLoC
βββ pages/ # App screens
βββ widgets/ # Reusable widgets
flutter_bloc- State management using BLoC patternequatable- Value equality for states and eventsget_it- Dependency injectiondartz- Functional programming utilities
go_router- Declarative routing
flutter_map- OpenStreetMap-based map widgetlatlong2- Geographical coordinatesgeolocator- GPS location services
sensors_plus- Access to device sensors (barometer)
dio- HTTP client for elevation API
flutter_animate- Smooth animationsgoogle_fonts- Typography
- Flutter SDK 3.35.4 or later
- Dart SDK 3.9.2 or later
- Android Studio / VS Code with Flutter extensions
- Physical device recommended (for sensor access)
-
Clone the repository:
git clone https://github.com/yourusername/height_map.git cd height_map -
Install dependencies:
flutter pub get
-
Run the app:
flutter run
flutter build apk --release
# or for app bundle
flutter build appbundle --releaseflutter build ios --releaseThe app uses Open Topo Data for elevation queries. The free API provides:
- SRTM 90m resolution worldwide coverage
- Up to 100 points per request
- Rate limiting applies for public API
For production use, consider hosting your own Open Topo Data instance.
ACCESS_FINE_LOCATION- GPS accessACCESS_COARSE_LOCATION- Network-based locationINTERNET- Elevation API access
NSLocationWhenInUseUsageDescription- Location access while using appNSLocationAlwaysAndWhenInUseUsageDescription- Background location (optional)
- Grant location permission when prompted
- Your current location appears on the map with a blue marker
- Current altitude is shown in the top-right corner
- Tap the altitude indicator to see detailed sensor readings
- Tap anywhere on the map to place a marker
- The elevation at that point will be fetched
- A card shows the elevation and difference from your position
- Tap the X to clear the selection
- View all available sensor readings
- See accuracy and reliability information
- Understand how each sensor works
Manages altitude data from all sensors.
Events:
StartHeightMonitoring- Begin sensor monitoringStopHeightMonitoring- Stop sensor monitoringFetchApiElevation- Fetch elevation for a position
States:
HeightInitial- Initial stateHeightLoading- Loading sensor dataHeightLoaded- Data available with all measurementsHeightError- Error state
Manages GPS location tracking.
Events:
StartLocationTracking- Begin location updatesStopLocationTracking- Stop location updatesGetCurrentLocation- Get location once
States:
LocationInitial- Initial stateLocationLoading- Fetching locationLocationLoaded- Location availableLocationPermissionDenied- Permission not grantedLocationServiceDisabled- GPS disabled
Manages map interactions and elevation comparisons.
Events:
MapTapped- User tapped on mapClearSelectedPoint- Clear selectionUpdateUserPosition- Update user location on map
States:
MapInitial- Initial stateMapReady- Map ready with optional selected point
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Open Topo Data for elevation data
- OpenStreetMap for map tiles
- Flutter team for the amazing framework