google_maps_place_search_advance 0.1.3 copy "google_maps_place_search_advance: ^0.1.3" to clipboard
google_maps_place_search_advance: ^0.1.3 copied to clipboard

Google Maps Place Search Advance provides programmatic access to Google's database for the place autocomplete search and also their landmark images, as well as distance with respect to the device's cu [...]

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:google_maps_place_search_advance/google_maps_place_search_advance.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Example of Google Maps Place Search Advance Package',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  FocusNode? focusNode;

  initState() {
    super.initState();
    focusNode = FocusNode();
  }

  dispose() {
    focusNode!.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        body: Container(
          child: SingleChildScrollView(
            child: GooglePlaceSearchAdvance(
              googleMapsApiKey: "GOOGLE_MAPS_API_KEY",
              lightTheme: false,
              country: "fr",
              iconImagePath: "assets/search.png",
              mapimagePath: "assets/not_image_place.png",
              onLocationSelected: (double lat, double lng, String address,
                  String mainText, String imageURL) {
                print("Coordinates are $lat,$lng");
                print("Address is : $address");
                print("Image URL is: $imageURL");
                print("Main Text is: $mainText");
              },
              focusNode: focusNode!,
            ),
          ),
        ),
      ),
    );
  }
}
4
likes
120
points
33
downloads

Publisher

unverified uploader

Weekly Downloads

Google Maps Place Search Advance provides programmatic access to Google's database for the place autocomplete search and also their landmark images, as well as distance with respect to the device's current place.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

flutter, geolocator, http, shimmer

More

Packages that depend on google_maps_place_search_advance