detect_fake_location_plus 1.0.4+1 copy "detect_fake_location_plus: ^1.0.4+1" to clipboard
detect_fake_location_plus: ^1.0.4+1 copied to clipboard

A Flutter plugin for detecting if location is being simulated or faked

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:detect_fake_location_plus/detect_fake_location.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'My App',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('My App'),
      ),
      body: Center(
        child: ElevatedButton(
          child: Text('检测虚拟定位'),
          onPressed: () async {
            bool isFakeLocation =
                await DetectFakeLocation().detectFakeLocation();
            showDialog(
              context: context,
              builder: (BuildContext context) {
                return AlertDialog(
                  title: Text('检测虚拟定位'),
                  content: Text(' 此用户${isFakeLocation ? '' : '不'}是虚拟定位'),
                  actions: <Widget>[
                    TextButton(
                      child: Text('OK'),
                      onPressed: () {
                        Navigator.of(context).pop();
                      },
                    ),
                  ],
                );
              },
            );
          },
        ),
      ),
    );
  }
}
3
likes
160
points
12
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for detecting if location is being simulated or faked

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, permission_handler, plugin_platform_interface

More

Packages that depend on detect_fake_location_plus