location_service 1.0.2 copy "location_service: ^1.0.2" to clipboard
location_service: ^1.0.2 copied to clipboard

A plugin for open and check location services in Android.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:location_service/location_service.dart';

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

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

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    bool isDone = await LocationService.checkIfLocationServiceEnabled();
    print(isDone);
    bool isHeppends = await LocationService.openLocationService();
    print(isHeppends);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on: $_platformVersion\n'),
        ),
      ),
    );
  }
}
1
likes
20
pub points
51%
popularity

Publisher

verified publishervaibhavpathakofficial.tk

A plugin for open and check location services in Android.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on location_service