detect_fake_location 1.0.0 copy "detect_fake_location: ^1.0.0" to clipboard
detect_fake_location: ^1.0.0 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/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('Detect Fake Location'),
          onPressed: () async {
            bool isFakeLocation =
                await DetectFakeLocation().detectFakeLocation();
            showDialog(
              context: context,
              builder: (BuildContext context) {
                return AlertDialog(
                  title: Text('Fake Location Detected'),
                  content: Text(
                      'The user is${isFakeLocation ? '' : ' not'} using a fake location.'),
                  actions: <Widget>[
                    TextButton(
                      child: Text('OK'),
                      onPressed: () {
                        Navigator.of(context).pop();
                      },
                    ),
                  ],
                );
              },
            );
          },
        ),
      ),
    );
  }
}
29
likes
0
points
1.02k
downloads

Publisher

verified publisherzeexan.com

Weekly Downloads

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

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, permission_handler, plugin_platform_interface

More

Packages that depend on detect_fake_location