flutter_google_location_picker 0.0.6 copy "flutter_google_location_picker: ^0.0.6" to clipboard
flutter_google_location_picker: ^0.0.6 copied to clipboard

A flutter plugin helps to search or pick location picker from map. It is completely free and easy to use.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_google_location_picker/flutter_google_location_picker.dart';
import 'package:flutter_google_location_picker/export.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Google Map Picker',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        useMaterial3: true,
        primaryColor: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Google Map Picker'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  final String title;

  const MyHomePage({super.key, required this.title});
  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
      ),
      body: FlutterGoogleLocationPicker(
        center: const LatLong(23.7662, 90.4255),
        selectLocationButtonStyle: ElevatedButton.styleFrom(
          backgroundColor: Colors.blue,
          foregroundColor: Colors.white,
        ),
        selectedLocationButtonTextstyle: const TextStyle(fontSize: 18, color: Colors.white),
        selectLocationButtonText: 'Set Current Location',
        selectLocationButtonLeadingIcon: const Icon(Icons.check, color: Colors.white),
        initZoom: 11,
        minZoomLevel: 5,
        maxZoomLevel: 16,
        trackMyPosition: true,
        onError: (e) => debugPrint(e.toString()),
        onPicked: (PickedData pickedData) {
          debugPrint("Picked: ${pickedData.latLong.latitude}, ${pickedData.latLong.longitude}");
          debugPrint("Address: ${pickedData.displayName}");
        },
        onChanged: (PickedData pickedData) {
          debugPrint("Changed: ${pickedData.latLong.latitude}, ${pickedData.latLong.longitude}");
        },
      ),
    );
  }
}
5
likes
160
points
119
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A flutter plugin helps to search or pick location picker from map. It is completely free and easy to use.

Homepage
Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

connectivity_plus, flutter, flutter_map, flutter_map_location_marker, geolocator, geolocator_linux, http, intl, latlong2

More

Packages that depend on flutter_google_location_picker