location_autocomplete 0.0.2 copy "location_autocomplete: ^0.0.2" to clipboard
location_autocomplete: ^0.0.2 copied to clipboard

A flutter package for location autocomplete using the Google Places API.

LocationAutocomplete #

Features #

Widget allowing you to search and select address using Google Place API

  • Address autocommplete
  • Location autocomplete (in person/virtual) Similar to Facebook Event Location Autocomplete

Preview

Getting started #

Usage #

For a simple address autocomplete use SimpleAddressSearchField

SimpleAddressSearchField(
                inputDecoration: InputDecoration(
                  labelText: "Search address",
                  hintText: "Search address",
                  border: OutlineInputBorder(
                    borderRadius: BorderRadius.circular(15),
                  ),
                ),
                googleApiKey: "<Google API KEY>",
                onSelected:
                    (address) =>
                        address != null
                            ? ScaffoldMessenger.of(context).showSnackBar(
                              SnackBar(
                                content: Text(
                                  'Address selected: ${address.formattedAddress}',
                                ),
                              ),
                            )
                            : null,
              )

For a for a more complex location search similar to the Facebook event location autocomplete use LocationSearchField

LocationSearchField(
    hintText: "Location Search address",
    labelText: "Location: in person or virtual",
    googleApiKey: "<Google API KEY>",
    onSelected:
        (address) =>
            address != null
                ? ScaffoldMessenger.of(context).showSnackBar(
                    SnackBar(
                    content: Text(
                        'Location selected: ${address.displayText}',
                      ),
                    ),
                )
                : null,
),

Todo #

2
likes
135
points
23
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A flutter package for location autocomplete using the Google Places API.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, http, uuid

More

Packages that depend on location_autocomplete