flutter_map_picker 0.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 90

flutter_map_picker #

Pick an area or a place on google maps

Getting Started #

Follow the steps to integrate Google Maps (https://pub.dev/packages/google_maps_flutter)

Pick area #

AreaPickerResult pickerResult = await Navigator.push(context, MaterialPageRoute(builder: (context) =>  AreaPickerScreen(
        googlePlacesApiKey: GOOGLE_PLACES_API_KEY,
        initialPosition: DEFAULT_LAT_LNG,
        mainColor: Colors.purple,
        mapStrings: MapPickerStrings.spanish(),
        placeAutoCompleteLanguage: 'es',
        markerAsset: 'assets/images/icon_look_area.png',
      )));

Screenshot

Screenshot

Pick address #

PlacePickerResult pickerResult = await Navigator.push(context, MaterialPageRoute(builder: (context) =>  PlacePickerScreen(
        googlePlacesApiKey: GOOGLE_PLACES_API_KEY,
        initialPosition: DEFAULT_LAT_LNG,
        mainColor: Colors.purple,
        mapStrings: MapPickerStrings.spanish(),
        placeAutoCompleteLanguage: 'es',
      )));

Screenshot

Screenshot

[0.0.1] - 23/03/2020. #

  • Initial release

[0.1.0] - 23/03/2020. #

  • Update version & description

[0.1.1] - 23/03/2020. #

  • Add repository

[0.1.2] - 30/03/2020. #

  • Update readme

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_map_picker/flutter_map_picker.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'google_places_api_key.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Map Picker Demo',
      theme: ThemeData(
        primarySwatch: Colors.purple,
      ),
      home: MyHomePage(title: 'Map Picker Demo'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

  static const LatLng DEFAULT_LAT_LNG = LatLng(40.416775, 	-3.703790); //Madrid

  String result = '';

  @override
  Widget build(BuildContext context) {


    pickArea() async{
      AreaPickerResult pickerResult = await Navigator.push(context, MaterialPageRoute(builder: (context) =>  AreaPickerScreen(
        googlePlacesApiKey: GOOGLE_PLACES_API_KEY,
        initialPosition: DEFAULT_LAT_LNG,
        mainColor: Colors.purple,
        mapStrings: MapPickerStrings.spanish(),
        placeAutoCompleteLanguage: 'es',
        markerAsset: 'assets/images/icon_look_area.png',
      )));

      setState(() {
        result = pickerResult.toString();
      });
    }

    pickPlace() async {
      PlacePickerResult pickerResult = await Navigator.push(context, MaterialPageRoute(builder: (context) =>  PlacePickerScreen(
        googlePlacesApiKey: GOOGLE_PLACES_API_KEY,
        initialPosition: DEFAULT_LAT_LNG,
        mainColor: Colors.purple,
        mapStrings: MapPickerStrings.spanish(),
        placeAutoCompleteLanguage: 'es',
      )));

      setState(() {
        result = pickerResult.toString();
      });
    }

    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          children: <Widget>[
            RaisedButton(
              onPressed: pickArea,
              child: Text("Pick area"),
            ),
            RaisedButton(
              onPressed: pickPlace,
              child: Text("Pick place"),
            ),
            Padding(
              padding: EdgeInsets.all(16),
              child: Text(result),
            )
          ],
        ),
      )
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_map_picker: ^0.1.2

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:flutter_map_picker/flutter_map_picker.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
80
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
90
Learn more about scoring.

We analyzed this package on Jul 10, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because:

  • package:flutter_map_picker/flutter_map_picker.dart that imports:
  • package:flutter_map_picker/src/map_place_picker.dart that imports:
  • package:location/location.dart that declares support for platforms: android, ios, macos, web

Package does not support Flutter platform macos

Because:

  • package:flutter_map_picker/flutter_map_picker.dart that imports:
  • package:flutter_map_picker/src/map_place_picker.dart that imports:
  • package:google_maps_flutter/google_maps_flutter.dart that declares support for platforms: android, ios

Package does not support Flutter platform web

Because:

  • package:flutter_map_picker/flutter_map_picker.dart that imports:
  • package:flutter_map_picker/src/map_place_picker.dart that imports:
  • package:google_maps_flutter/google_maps_flutter.dart that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because:

  • package:flutter_map_picker/flutter_map_picker.dart that imports:
  • package:flutter_map_picker/src/map_place_picker.dart that imports:
  • package:location/location.dart that declares support for platforms: android, ios, macos, web

Package not compatible with SDK dart

Because:

  • flutter_map_picker that is a package requiring null.

Health suggestions

Format lib/flutter_map_picker.dart.

Run flutter format to format lib/flutter_map_picker.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
flutter 0.0.0
flutter_google_places ^0.2.4 0.2.5
geocoder ^0.2.1 0.2.1
google_maps_flutter ^0.5.25 0.5.28+1
google_maps_utils ^1.2.0+3 1.2.1+1
location ^3.0.1 3.0.2
Transitive dependencies
charcode 1.1.3
collection 1.14.12 1.14.13
csv 4.0.3
flutter_plugin_android_lifecycle 1.0.8
flutter_web_plugins 0.0.0
google_maps_flutter_platform_interface 1.0.2
google_maps_webservice 0.0.17
http 0.12.1
http_parser 3.1.4
js 0.6.2
location_platform_interface 1.0.0
location_web 1.0.0
meta 1.1.8 1.2.2
path 1.7.0
pedantic 1.9.0 1.9.2
plugin_platform_interface 1.0.2
poly 1.0.7+2
rxdart 0.24.1
sky_engine 0.0.99
source_span 1.7.0
stack 0.1.0
stream_transform 1.2.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test