accuracy_setting 1.0.0 copy "accuracy_setting: ^1.0.0" to clipboard
accuracy_setting: ^1.0.0 copied to clipboard

outdated

Get Location Accuracy Setting, Sometimes you need higher accuracy to get better results, or you need to make sure GPS is activated. If so, this plugin is for you.

example/lib/main.dart

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

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: FlatButton(
            child: Text(
              'Get Accuracy Setting',
            ),
            onPressed: () async {
              AccuracySettingMode mode =
                  await AccuracySetting.getAccuracySetting();
              print(mode);

              if (await AccuracySetting.getProviderEnabled(
                  LocationProvider.GPS)) {
                print("GPS Active");
              }

              if (await AccuracySetting.getProviderEnabled(
                  LocationProvider.NETWORK)) {
                print("Network Active");
              }
            },
          ),
        ),
      ),
    );
  }
}
3
likes
30
points
32
downloads

Publisher

verified publisherfuadarradhi.com

Weekly Downloads

Get Location Accuracy Setting, Sometimes you need higher accuracy to get better results, or you need to make sure GPS is activated. If so, this plugin is for you.

Repository (GitHub)

License

unknown (license)

Dependencies

flutter

More

Packages that depend on accuracy_setting