Search packages, repositories and app categories

Package detailsv0.10.0

google_directions_api

The Directions API is a service that calculates directions between locations. You can search for directions for several modes of transportation.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
1.3K
Likes
57
Pub points
140

Install package

flutter pub add google_directions_api

Package Overview

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

The google_directions_api package provides a Flutter interface to the Google Directions API, enabling developers to calculate routes between locations using various transportation modes such as driving, walking, cycling, and transit. It supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux. The package simplifies integration with Google's routing services, allowing apps to display turn-by-turn directions, travel time estimates, and distance calculations. It is ideal for navigation, trip planning, and location-based applications requiring route data.

Use cases

  • Navigation apps
  • Trip planning features
  • Delivery route optimization
  • Location-based service enhancements
  • Real-time transit direction lookup

Key features

  • Supports multiple transport modes
  • Cross-platform compatibility
  • Simple API integration
  • Route distance and duration calculation
  • Turn-by-turn direction support

Suitable for

  • Developers building navigation tools
  • Apps requiring route planning
  • Travel and logistics applications
  • Mobile and web location services
  • Integrating Google Maps routing features

Considerations

  • Requires Google Cloud Platform API key
  • Rate limits apply based on usage
  • Additional costs may incur with high volume
  • Internet connection required for real-time data
  • Needs proper handling of API error responses

Original README

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

google_directions_api

Build Pub GitHub GitHub stars

The Directions API is a service that calculates directions between locations. You can search for directions for several modes of transportation, including transit, driving, walking, or cycling.

Getting Started

The Directions API is a service that calculates directions between locations using an HTTP request.

With the Directions API, you can:

  • Search for directions for several modes of transportation, including transit, driving, walking or cycling.
  • Return multi-part directions using a series of waypoints.
  • Specify origins, destinations, and waypoints as text strings (e.g. "Chicago, IL" or "Darwin, NT, Australia"), or as latitude/longitude coordinates, or as place IDs.

The API returns the most efficient routes when calculating directions. Travel time is the primary factor optimized, but the API may also take into account other factors such as distance, number of turns and many more when deciding which route is the most efficient.

Note: This service is not designed to respond in real time to user input.

For full info about Directions API visit official documentation

Usage
import 'package:google_directions_api/google_directions_api.dart';

void main() {
  DirectionsService.init('API_KEY');

  final directionsService = DirectionsService();

  final request = DirectionsRequest(
    origin: 'New York',
    destination: 'San Francisco',
    travelMode: TravelMode.driving,
  );

  directionsService.route(request,
      (DirectionsResult response, DirectionsStatus status) {
    if (status == DirectionsStatus.ok) {
      // do something with successful response
    } else {
      // do something with error response
    }
  });
}

Feature requests and Bug reports

Feel free to post a feature requests or report a bug here.

TODO

  • Write tests via mocks

Categories

Dependencies

Dependency list 3 items

Source repository

Projects using this package