location 5.0.0-dev.7 copy "location: ^5.0.0-dev.7" to clipboard
location: ^5.0.0-dev.7 copied to clipboard

This librarie aims at providing you a simple way to get the user location without thinking about permission.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:location_example/change_notification.dart';
import 'package:location_example/change_settings.dart';
import 'package:location_example/get_location.dart';
import 'package:location_example/listen_location.dart';
import 'package:location_example/permission_status.dart';
import 'package:location_example/service_enabled.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: 'Flutter Location',
      theme: ThemeData(
        primarySwatch: Colors.amber,
      ),
      home: const MyHomePage(title: 'Flutter Location Demo'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key, this.title});
  final String? title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(title!),
      ),
      body: SingleChildScrollView(
        child: Column(
          children: const <Widget>[
            SizedBox(height: 16),
            PermissionStatusWidget(),
            Divider(height: 32),
            ServiceEnabledWidget(),
            Divider(height: 32),
            GetLocationWidget(),
            Divider(height: 32),
            ListenLocationWidget(),
            Divider(height: 32),
            ChangeSettings(),
            Divider(height: 32),
            ChangeNotificationWidget()
          ],
        ),
      ),
    );
  }
}
2765
likes
0
pub points
100%
popularity

Publisher

verified publisherbernos.dev

This librarie aims at providing you a simple way to get the user location without thinking about permission.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, location_android, location_ios, location_macos, location_platform_interface, location_web

More

Packages that depend on location