Search packages, repositories and app categories

Package detailsv1.0.8

routing_client_dart

Dart Package for Routing Client Api ( support OSRM/Valhalla project )

AndroidiOSWebmacOSWindowsLinux
30-day downloads
6.3K
Likes
25
Pub points
130

Install package

flutter pub add routing_client_dart

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Dart package that provides client-side routing capabilities for OpenStreetMap-based routing engines like OSRM and Valhalla. It enables developers to integrate real-time route calculation into cross-platform applications, supporting Android, iOS, Web, macOS, Windows, and Linux. The package simplifies API interactions with routing services, offering a clean interface for requesting routes, handling responses, and managing errors. Ideal for navigation and location-aware apps requiring efficient pathfinding.

Use cases

  • Real-time route planning
  • Navigation app development
  • Geospatial data analysis
  • Multi-platform location tracking
  • Integration with OSRM or Valhalla servers

Key features

  • Supports OSRM and Valhalla routing APIs
  • Cross-platform compatibility
  • Simple request/response handling
  • Error resilience
  • Lightweight and easy to integrate

Suitable for

  • Mobile and web navigation apps
  • Logistics and delivery platforms
  • Outdoor activity tracking tools
  • Location-based service integrations
  • Developers using OpenStreetMap data

Considerations

  • Requires external OSRM or Valhalla server
  • Network connectivity needed for routing requests
  • Limited to OSM-based routing providers
  • No built-in map rendering
  • Authentication may be required for some servers

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Routing Client Dart Package

pub

Package for osm routing client api

we support routing API for osrm-backend

also Valhalla Route API (more APIs will be added )

openrouteservice (coming soon)

from 1.0.0 instruction will be included directly when requesting the route

you can use our osrm service or valhalla service directly insteado of our RoutingManager

client api support
  • OSRM Client Api
    • route service
    • trip service
  • Valhalla Client
    • route service API

Installing

Add the following to your pubspec.yaml file:

dependencies:
  routing_client_dart: ^1.0.7
example for osrm route service
    List<LngLat> waypoints = [
      LngLat(lng: 13.388860, lat: 52.517037),
      LngLat(lng: 13.397634, lat: 52.529407),
      LngLat(lng: 13.428555, lat: 52.523219),
    ];
    final manager = RoutingManager();
    final route = await manager.getRoute(
      OSRMRequest.route(
        waypoints: waypoints,
        geometries: Geometries.polyline,
        steps: true,
        languages: Languages.en,
      )
    );
example for osrm trip service
    List<LngLat> waypoints = [
      LngLat(lng: 13.388860, lat: 52.517037),
      LngLat(lng: 13.397634, lat: 52.529407),
      LngLat(lng: 13.428555, lat: 52.523219),
    ];
    final manager = RoutingManager();
    final road = await manager.getRoute(
      OSRMRequest.trip(
        waypoints: waypoints,
        destination: DestinationGeoPointOption.last,
        source: SourceGeoPointOption.first,
        geometries: Geometries.polyline,
        steps: true,
        languages: Languages.en,
        roundTrip:false,
      )
    );
example for check Location in Road
final currentLocation = LngLat.fromList(lnglat: [13.389147, 52.527549]);
    final isOnPath =
await roadManager.isOnPath(road, currentLocation, tolerance: 5);
Example to get next navigation instruction of current Location
final currentLocation = LngLat.fromList(lnglat: [13.389147, 52.527549]);
    final isOnPath =
final instruction = await roadManager.nextInstruction(instructions, road, currentLocation, tolerance: 5);

Warning the precision of LngLat should be 5 if the road contain polylineEncoded, or the same precies as LngLat in polylines

Note you can get some inaccurate information nextInstruction,for that we will be happy for yours contributions

Note you can get voice instruction for valhalla instruction

Note more documentation will be added to soon

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package