get_my_location 2.1.1 copy "get_my_location: ^2.1.1" to clipboard
get_my_location: ^2.1.1 copied to clipboard

A Flutter package to easily fetch and display device location with automatic permission handling. Perfect for apps needing quick GPS access with customizable UI states.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:get_my_location/src/location_getter.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(home: LocationGetterExample());
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Get My Location Example')),
      body: Padding(
        padding: const EdgeInsets.all(16),
        child: Center(
          child: LocationGetter(
            onLocationFetched: (location) {
              debugPrint('Location fetched: $location');
            },
            onError: (error) {
              debugPrint('Location error: $error');
            },
          ),
        ),
      ),
    );
  }
}
3
likes
140
points
97
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package to easily fetch and display device location with automatic permission handling. Perfect for apps needing quick GPS access with customizable UI states.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

unknown (license)

Dependencies

flutter, geocoding, geolocator, permission_handler, provider

More

Packages that depend on get_my_location