Skip to content

coderaveHQ/dart_mapbox_search

dart_mapbox_search

Mapbox Search made easy! 💎

A Dart package for interacting with the Mapbox Search Box and Geocoding APIs. It provides a set of utilities and models to facilitate integration with Mapbox's powerful search capabilities.

pub package License

Developed with 💙 and maintained by scial.app

"Buy Me A Coffee"

Supported features

Feature API Endpoint Available
Get suggested results Search Box API /suggest
Retrieve a suggested feature Search Box API /retrieve
Get search results Search Box API /forward
Retrieve POIs by category Search Box API /category
Get category list Search Box API /list/category
Do a reverse lookup Search Box API /reverse
Forward geocoding with search text input Geocoding API /forward
Forward geocoding with structured input Geocoding API /forward
Reverse geocoding Geocoding API /reverse
Batch geocoding Geocoding API /batch

Quick Start 🚀

Installation 🧑‍💻

In the dependencies section of your pubspec.yaml, add the following line:

dependencies:
  dart_mapbox_search: <latest_version>

Usage 👽

Import the package:

import 'package:dart_mapbox_search/dart_mapbox_search.dart';

Create an instance:

late final MapboxSearchClient mapboxSearch;

void main() async {
    final MapboxSearch result = MapboxSearch.initialize(accessToken: '...');
    mapboxSearch = result.client;
}

Make use of one of the many methods provided by this package e.g.:

final MapboxSearchResult<MapboxSearchSuggestResponse> response = await mapboxSearch.search.suggest('scial Headquarter');
response.fold(
    onSuccess: (MapboxSearchSuggestResponse data) => print('Data found!'), 
    onFailure: (int statusCode, String? message, String? error) => print('Error occured.')
);

Contribution 💙

Always open for contribution! Contributors will be listed here.

About

The official repository of the dart_mapbox_search package

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages