dart_mapbox_search 1.0.1

SDKdartflutter
Platformandroidioswindowslinuxmacosweb

A Dart package for the Mapbox Search Box and Geocoding APIs.

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

FeatureAPIEndpointAvailable
Get suggested resultsSearch Box API/suggest:white_check_mark:
Retrieve a suggested featureSearch Box API/retrieve:white_check_mark:
Get search resultsSearch Box API/forward:white_check_mark:
Retrieve POIs by categorySearch Box API/category:white_check_mark:
Get category listSearch Box API/list/category:white_check_mark:
Do a reverse lookupSearch Box API/reverse:white_check_mark:
Forward geocoding with search text inputGeocoding API/forward:white_check_mark:
Forward geocoding with structured inputGeocoding API/forward:white_check_mark:
Reverse geocodingGeocoding API/reverse:white_check_mark:
Batch geocodingGeocoding API/batch:x:

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.