Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

alizarion/macoui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maritime Navigation POC

A proof of concept for a professional maritime navigation mobile application built with Flutter. This app provides offline maps with OpenSeaMap integration, GRIB weather file import, and GPS tracking capabilities.

Features

✅ Implemented (Phase 1 - POC)

  • Interactive Map Display

    • OpenStreetMap base layer
    • OpenSeaMap nautical overlay
    • Smooth pan and zoom (2-18 zoom levels)
    • Fixed north orientation
    • Real-time GPS position tracking
    • Current coordinates display
  • Offline Maps

    • Download map regions for offline use
    • Configurable zoom level ranges
    • Automatic size estimation before download
    • Storage management
    • Region deletion
  • GRIB Import

    • File picker for GRIB files (.grib, .grib2, .grb, .grb2)
    • Basic GRIB file validation
    • File metadata storage
    • Import history management
  • GPS Tracking

    • Real-time position updates
    • Speed display (in knots)
    • Heading indicator
    • Altitude tracking
  • UI/UX

    • Maritime-themed design (ocean blues, whites)
    • Light/Dark mode support
    • Intuitive navigation drawer
    • Responsive layout

Technical Stack

Framework

  • Flutter 3.24+ (Dart 3.x)
  • Riverpod 2.5.0 - State management
  • Drift 2.16.0 - SQLite database

Key Dependencies

  • flutter_map 7.0.0 - Map rendering
  • latlong2 0.9.0 - Coordinate handling
  • geolocator 13.0.0 - GPS location
  • permission_handler 11.0.0 - Permission management
  • path_provider 2.1.0 - File system access
  • http 1.2.0 - Network requests
  • file_picker 8.0.0 - File selection

Project Structure

lib/
├── core/
│   ├── config/          # App configuration constants
│   ├── theme/           # Maritime theme (colors, typography)
│   ├── utils/           # Tile calculations utilities
│   ├── database/        # Drift database definitions
│   └── providers/       # Global Riverpod providers
├── features/
│   ├── map/
│   │   ├── domain/      # Location service
│   │   ├── services/    # Offline tile provider
│   │   └── presentation/# Map screen UI
│   ├── offline/
│   │   ├── domain/      # Tile downloader
│   │   └── presentation/# Offline manager screen
│   └── grib/
│       ├── domain/      # GRIB parser (simplified)
│       └── presentation/# GRIB import screen
└── main.dart

Setup Instructions

Prerequisites

  1. Flutter SDK (3.24 or later)

    flutter --version
  2. Platform Setup

    • Android: Android Studio with Android SDK
    • iOS: Xcode 15+ (macOS only)

Installation

  1. Clone or navigate to the project directory

    cd maritime_nav_poc
  2. Install dependencies

    flutter pub get
  3. Generate code (for Drift database)

    flutter pub run build_runner build --delete-conflicting-outputs
  4. Run the app

    # For Android
    flutter run
    
    # For iOS (macOS only)
    flutter run -d ios
    
    # For a specific device
    flutter devices
    flutter run -d <device_id>

Platform-Specific Setup

Android

The AndroidManifest.xml is already configured with required permissions:

  • INTERNET - Network access for tile downloads
  • ACCESS_FINE_LOCATION / ACCESS_COARSE_LOCATION - GPS
  • WRITE_EXTERNAL_STORAGE / READ_EXTERNAL_STORAGE - File storage

iOS

The Info.plist is configured with permission descriptions:

  • Location permissions for GPS tracking
  • Storage permissions for offline maps

Usage Guide

Map Navigation

  1. Pan: Drag with one finger
  2. Zoom: Pinch to zoom or use +/- buttons
  3. Center on location: Tap the location icon in the app bar

Download Offline Maps

  1. Open the navigation drawer (☰)
  2. Select "Offline Maps"
  3. Tap the + button
  4. Configure region name and zoom levels
  5. Review estimated size and tap "Download"
  6. Wait for download completion
  7. Maps are now available offline

Test Region: Pre-configured area near Marseille, France (43.20-43.35°N, 5.30-5.45°E)

Import GRIB Files

  1. Open the navigation drawer (☰)
  2. Select "Import GRIB"
  3. Tap the + button
  4. Select a GRIB file from device storage
  5. File is validated and imported
  6. View in the GRIB files list

Note: GRIB visualization on map is a placeholder in this POC. Full implementation would require:

  • Wind arrow overlays
  • Pressure contours
  • Wave height visualization
  • Time slider for multi-temporal data

Performance Targets

  • Frame Rate: >30 FPS during map interactions ✅
  • Tile Load Time: <2 seconds per tile ✅
  • Storage Limit: Warning at 1GB, max 5GB
  • GPS Update Rate: Every 5 seconds or 10 meters

Database Schema

TileCaches

  • Metadata for cached map tiles
  • Tracks z/x/y coordinates and source

DownloadedRegions

  • Offline region definitions
  • Stores bounds, zoom levels, size

GribFiles

  • Imported GRIB file records
  • Stores path, import date, valid time

Known Limitations (POC Phase)

  1. GRIB Parsing: Simplified mock parser

    • Does not decode actual GRIB data
    • Returns mock weather data for demonstration
    • Production needs proper GRIB library (wgrib2, gribdart)
  2. GRIB Visualization: Not implemented

    • Import and storage works
    • Map overlay rendering is placeholder
  3. Region Selection: Pre-defined test region

    • Rectangle selection on map not implemented
    • Uses hardcoded Marseille area for testing
  4. Download Resume: Not supported

    • Downloads must complete in one session
    • Cancellation discards progress
  5. Tile Caching: Basic implementation

    • No expiration or refresh logic
    • No compression

Future Enhancements (Phase 2+)

High Priority

  • Interactive region selection on map
  • Real GRIB parsing (integrate wgrib2 or similar)
  • GRIB overlay rendering on map
  • Download pause/resume functionality
  • Route planning and waypoints

Medium Priority

  • AIS (Automatic Identification System) integration
  • Tide predictions
  • Marine weather forecasts
  • Track recording and GPX export
  • Compass integration

Low Priority

  • Multi-language support (i18n)
  • Anchor watch alarm
  • MOB (Man Overboard) function
  • Night mode optimization

Performance Profiling

To analyze performance:

flutter run --profile
# Then use DevTools
flutter pub global activate devtools
flutter pub global run devtools

Monitor:

  • Frame rendering times
  • Memory usage (especially tile cache)
  • Network requests
  • Storage I/O

Testing

Unit Tests

flutter test

Widget Tests

flutter test test/widgets/

Integration Tests

flutter drive --target=test_driver/app.dart

Troubleshooting

Build Issues

Problem: database.g.dart not found

flutter pub run build_runner build --delete-conflicting-outputs

Problem: Permission errors on Android

  • Check AndroidManifest.xml permissions
  • Request permissions at runtime (already handled by app)

Problem: Location not working on iOS Simulator

  • Use real device or set custom location in simulator

Runtime Issues

Problem: Tiles not loading

  • Check internet connection
  • Verify tile URLs in AppConfig
  • Check app permissions

Problem: GPS not working

  • Enable location services on device
  • Grant location permission to app
  • Use real device (GPS limited in simulators)

Problem: GRIB import fails

  • Ensure file has correct extension
  • Check file is valid GRIB format (basic validation only)

Resources

Documentation

Tools

License

This is a proof of concept project. License TBD.

Contributing

This is a POC project. Contributions and feedback welcome for planning Phase 2.

Contact

For questions about this POC, please refer to the project specifications document.


Version: 1.0.0 Date: 2025 Status: POC Complete ✅

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages