location_picker 0.0.11 copy "location_picker: ^0.0.11" to clipboard
location_picker: ^0.0.11 copied to clipboard

outdatedDart 1 only

A location picker plugin for Flutter.

location_picker #

A location picker plugin for Flutter.

What it does #

As the name implies, this is a component for getting a desired location from the user. It handles location permissions requests, a native map view and it return a map with all the data. It also uses reversed GeoCoding for info associated with the selected location.

Example #

       //NECESSARY
       LocationPicker.initApiKey('YOUR API KEY');
       
       LocationPicker picker = new LocationPicker();
       
       try 
       {
         result = await picker.showLocationPicker;
       } 
         on PlatformException 
       {
         //HANDLE ERROR
       }
       
       setState(() {_locationPickerData = result.toString();});

Configuration #

The constructor

new LocationPicker();

Takes the following optional parameters for configuration:

      String titleText;
      bool closeIfLocationDenied;
      bool useGeoCoder;
      double initialLat;
      double initialLong;
      bool enableMyLocation;
    
      //ANDROID ONLY
      String androidAppBarColor;
      String androidNavBarColor;
      String androidStatusBarColor;
      String androidSelectButtonColor;
      String androidTitleAndBackButtonColor;
    
      //IOS ONLY
      String iosBackButtonText;
      String iosSelectButtonText;

Importing #

  1. Add this line to your pubspec.yaml

     location_picker: ^0.0.1
    

Installing #

  1. Get your Google Maps Api Key.

Android #

  1. Request permissions in your manifest

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    
  2. Add your Android API Key in your manifest inside the application tag

    <meta-data
     android:name="com.google.android.geo.API_KEY"
     android:value="YOUR API KEY"/>
    

IOS #

  1. Request permissions in your project's info.plist

    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Your message to the user</string>
    

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

0
likes
0
pub points
60%
popularity

Publisher

unverified uploader

A location picker plugin for Flutter.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on location_picker