detect_fake_location_plus 1.0.4 copy "detect_fake_location_plus: ^1.0.4" to clipboard
detect_fake_location_plus: ^1.0.4 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();
                      },
                    ),
                  ],
                );
              },
            );
          },
        ),
      ),
    );
  }
}
2
likes
160
pub points
65%
popularity

Publisher

unverified uploader

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