mapbox_search 1.0.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 83

mapbox_search #

Pub Awesome Flutter

PR ? You're most welcomed.... #

MapBox Search and Static Image pure Dart Implementation #

A Flutter package for place search using MapBox Api, Reverse Geocoding and for Static map image. #

Reverse Geocoding displays the nearby places based on the feeded Location data. #

I made this package because google place search was not working that much efficiently(daily quota limit) and MapBox offers plenty of free search requests. #

Way more useful than google if you want static map images... #

Installing #

Add the following to your pubspec.yaml file:

  mapbox_search: any

Example #

Static Image #

MapBoxStaticImage staticImage = MapBoxStaticImage(
        "API Key");

Image With Polyline #

String getStaticImageWithPolyline() => staticImage.getStaticUrlWithPolyline(
  point1: Location(lat: 37.77343, lng: -122.46589),
  point2: Location(lat: 37.75965, lng: -122.42816),
  marker1: MapBoxMarker( markerColor:, markerLetter: 'p', markerSize: MarkerSize.LARGE),
  msrker2: MapBoxMarker(
      markerColor: Colors.redAccent,
      markerLetter: 'q',
      markerSize: MarkerSize.SMALL),
  height: 300,
  width: 600,
  zoomLevel: 16,
  style: MapBoxStyle.Mapbox_Dark,
  path: MapBoxPath(pathColor:, pathOpacity: 0.5,     pathWidth: 5),
  render2x: true);

Image with Marker #

String getStaticImageWithMarker() => staticImage.getStaticUrlWithMarker(
  center: Location(lat: 37.77343, lng: -122.46589),
  marker: MapBoxMarker(
      markerColor:, markerLetter: 'p', markerSize: MarkerSize.LARGE),
  height: 300,
  width: 600,
  zoomLevel: 16,
  style: MapBoxStyle.Mapbox_Streets,
  render2x: true,

Image without Marker #

String getStaticImageWithoutMarker() => staticImage.getStaticUrlWithoutMarker(
    center: Location(lat: 37.75965, lng: -122.42816),
    height: 300,
    width: 600,
    zoomLevel: 16,
    style: MapBoxStyle.Mapbox_Outdoors,
    render2x: true,

Search Widget #

      popOnSelect: true,
          "API KEY",
      limit: 10,
      onSelected: (place) {},
      context: context,

Reverse GeoCoding #

ReverseGeoCoding reverseGeoCoding = ReverseGeoCoding(
    apiKey: 'API Key',
    limit: 5,
Future<List<MapBoxPlace>> getPlaces() async =>
  await reverseGeoCoding.getAddress(
    Location(lat: 72.0, lng: 76.00),

Screenshots #

Static Map Image #

Static Map Image

Search Widget #


[1.0.0] - 26 August 2019.

Initial release.


  • Places Search with prediction
  • Static Image with marker
  • Static Image without Marker
  • Static Image with Polyline path

[1.0.1] - 27 August 2019.


  • add defaultPathPolyline and add assert(Merge Request)

[1.0.2] - 30 August 2019.


  • Reverse Geocoding Added

[1.0.3] - 10 September 2019.

  • Reverse Geocoding returning empty list bug Solved

[1.0.4] - 19 October 2019.

  • Reverse Geocoding query type set to dynamic(String or double)


example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  mapbox_search: ^1.0.4

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:mapbox_search/mapbox_search.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Dec 13, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.1+4
  • Flutter: 1.12.13+hotfix.4

Health suggestions

Fix lib/src/MapBoxStaticImage.dart. (-0.50 points)

Analysis of lib/src/MapBoxStaticImage.dart reported 1 hint:

line 273 col 56: Avoid using braces in interpolation when not needed.

Fix lib/src/Predections.dart. (-0.50 points)

Analysis of lib/src/Predections.dart reported 1 hint:

line 8 col 15: Name non-constant identifiers using lowerCamelCase.

Format lib/mapbox_search.dart.

Run flutter format to format lib/mapbox_search.dart.

Format lib/src/Location.dart.

Run flutter format to format lib/src/Location.dart.

Maintenance issues and suggestions

Use constrained dependencies. (-20 points)

The pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies: http.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.2 <3.0.0
flutter 0.0.0
http any 0.12.0+2
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.11 1.14.12
http_parser 3.1.3
meta 1.1.8
path 1.6.4
pedantic 1.9.0
sky_engine 0.0.99
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies