A hands-on Flutter tutorial app for exploring the Magic Lane Maps SDK for Flutter. Learn how to build interactive maps, search for places, navigate turn-by-turn, calculate routes, download offline maps and route recording. Feel free to draw inspiration from it for your own Magic Lane SDK projects, whether partially or entirely.
- High-performance map rendering
- Responsive pan and zoom with gesture controls
- Multi-touch gestures support (pinch, rotate, tilt)
- Touch-based landmark selection and POI interaction
- Real-time GPS location tracking
- Follow position mode with automatic map centering
- Location permission handling for iOS and Android
- Real-time search by name and address
- Persistent search history with recent queries
- Distance display from current map center
- Multi-modal routing (car, truck, pedestrian, bike, public transport)
- Route visualization on map
- Route metrics display (distance, duration, ETA)
- Real-time navigation with live position tracking
- Navigation simulation mode for testing
- Turn instructions with distance to next maneuver
- Destination reached notifications
- Browse and download regional map packages
- Download progress tracking with pause/resume
- Manage downloaded maps (view, delete)
- Offline support for downloaded regions
- Record GPS tracks with precise coordinates
- Pause/resume recording during activities
- Visualize recorded routes on map
- Track metadata (distance, duration, elevation, speed)
- Recording history and GPX export capability
- Flutter SDK:
^3.35.1or higher - Dart SDK:
^3.9.0or higher - IDE: VS Code, Android Studio, or IntelliJ IDEA
- Magic Lane API Token
- Platform-specific tools:
- For iOS: Xcode
- For Android: Android Studio
-
Configure your API token
An API Key is required to unlock the full functionality of these example applications. Follow our guide to generate your API Key.
If no API Key is set, you can still test your apps, but a watermark will be displayed, and all the online services including mapping, searching, routing, etc. will slow down after a few minutes.
You can either set your API Key directly in the
main.dartfile or pass the token directly when running or building the app with the--dart-define=GEM_TOKEN=your_api_token_herecommand line option. -
Platform-specific setup
First, prepare the project:
flutter clean flutter pub get
- Generate an APK using the command:
flutter build apkwith optional--debugor--releaseflags - Deploy to a connected device using:
flutter run --use-application-binary build/app/outputs/flutter-apk/app-[debug|release].apk
- Build the iOS application:
flutter build ios - Deploy to a connected device:
flutter run
Alternatively, open the Xcode workspace located at
<project-path>/ios/Runner.xcworkspaceto build, execute and debug directly from Xcode. - Generate an APK using the command:
This Flutter application features a clear separation of concerns using the Provider pattern for state management:
lib/
├── main.dart # App entry point
├── providers/ # State management (Provider pattern)
│ ├── app_providers.dart # Provider configuration
│ ├── gem_map_provider.dart # Map state
│ ├── selected_landmark_provider.dart
│ ├── follow_position_provider.dart
│ ├── routing_state_provider.dart
│ ├── navigation_state_provider.dart
│ └── recording_provider.dart # Recording state management
├── services/ # Business logic layer
│ ├── recording_service.dart # SDK recording operations
│ ├── android_foreground_service.dart
│ └── error_service.dart # Error handling
├── widgets/ # Reusable UI components
│ ├── app_map.dart # Main map widget
│ ├── map_overlay_manager.dart # UI overlay coordination
│ ├── recordings_button.dart
│ └── clear_recording_button.dart
├── search/ # Search functionality
│ ├── search_bar_widget.dart
│ ├── search_page.dart
│ └── search_result_item.dart
├── routing/ # Routing features
│ ├── transport_mode_button.dart
│ ├── routing_engine.dart
│ └── routing_panel.dart
├── navigation/ # Navigation features
│ └── navigation_panel.dart
├── recording/ # Recording features
│ └── recordings_history_page.dart
├── map_downloads/ # Offline maps
│ ├── map_downloads_button.dart
│ ├── map_download_page.dart
│ ├── map_download_item.dart
│ ├── controllers/
│ └── widgets/
├── landmark/ # Landmark features
│ └── landmark_panel.dart
├── l10n/ # Internationalization
│ └── app_localizations.dart
├── shared/ # Shared utilities
│ ├── constants/
│ └── widgets/
└── utils/ # Helper functions
The app launches with an interactive map centered on a default location. Use standard gestures:
- Pan: Drag to move the map
- Zoom: Pinch to zoom in/out or double-tap
- Rotate: Two-finger rotation gesture
- Tap the location button (bottom-right)
- Grant location permissions when prompted
- Map will center on your current location
- Tap the search bar at the top
- Type a place name, address, or category
- Select from search results
- View location on map with landmark panel
- View recent searches by tapping the search bar again
- Select transportation mode (car, pedestrian, bike)
- Search and select a destination landmark
- Tap the route button in the landmark panel
- View route details and alternatives
- Tap Start Navigation to begin turn-by-turn guidance
- Tap the download button (floating action button)
- Browse available map regions
- Tap Available Tab for desired regions
- Monitor download progress
- Switch to Downloaded tab to view and manage downloaded maps
- Tap the record button (bottom-right)
- Grant necessary permissions (location, notifications)
- Start recording your route
- Pause/Resume as needed
- Stop when finished
- View recordings in History (top-right button)
- Tap a recording to view on map
This repository includes comprehensive step-by-step tutorials for implementing each Flutter mapping feature from scratch:
- Display Map Tutorial - Basic map integration
- Follow Position Tutorial - GPS tracking and follow mode
- Landmark Selection Tutorial - Interactive landmark selection
- Search Functionality Tutorial - Implementing search features
- Routing Tutorial - Route calculation and display
- Navigation Tutorial - Turn-by-turn guidance
- Map Download Tutorial - Offline map management
- Recording Tutorial - Route recording implementation
Each tutorial includes a detailed explanation of the concepts, code snippets, and instructions to implement the features step-by-step.
The app supports internationalization using Flutter's localization framework:
- Supported Languages: English (default), easily extensible
- Localization Files:
lib/l10n/ - Generated Classes:
app_localizations.dart
- Create ARB files in
lib/l10n/ - Run code generation:
flutter gen-l10n
- Add locale to
supportedLocalesinmain.dart
| Platform | Supported | Notes |
|---|---|---|
| Android | ✅ | Minimum SDK 23 (Android 6.0 Marshmallow) |
| iOS | ✅ | Minimum iOS 14.0 |
| Package | Version | Purpose |
|---|---|---|
magiclane_maps_flutter |
^3.1.5 | Magic Lane Maps SDK |
provider |
^6.1.5+1 | State management |
permission_handler |
^12.0.1 | Runtime permissions |
intl |
^0.20.2 | Internationalization |
path |
^1.9.1 | File path manipulation |
path_provider |
^2.1.5 | App directory access |
| Package | Version | Purpose |
|---|---|---|
flutter_local_notifications |
^19.5.0 | Foreground service notifications |
flutter_background_service |
^5.1.0 | Background recording support |
- Magic Lane Maps SDK for Flutter Guide
- Magic Lane Getting Started Guide
- Flutter Maps SDK API Reference
- Magic Lane Maps SDK for Flutter Package
- Magic Lane Maps SDK Examples for Flutter
Copyright (C) 2025-2026 Magic Lane International B.V.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
A copy of the license is available in the repository's LICENSE file.
Contact Magic Lane at info@magiclane.com for SDK licensing options.
