detect_false_gps 0.0.3 copy "detect_false_gps: ^0.0.3" to clipboard
detect_false_gps: ^0.0.3 copied to clipboard

PlatformiOS

Faz detecção nativa de GPS falso no iPhone.

example/lib/main.dart

import 'package:detect_false_gps/detect_false_gps.dart';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  bool? _isFakeGps;

  Future<void> _checkFakeGps() async {
    setState(() => _isFakeGps = null);
    if (await Permission.locationWhenInUse.request().isGranted) {
      final isFake = await DetectFalseGps.isFakeGps();
      setState(() {
        _isFakeGps = isFake;
      });
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Exemplo Fake GPS'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(
                _isFakeGps == null
                    ? 'Verificando...'
                    : _isFakeGps!
                        ? 'Fake GPS detectado!'
                        : 'GPS legítimo.',
                style: TextStyle(
                  fontSize: 20,
                  color: _isFakeGps == null ? Colors.black : (_isFakeGps! ? Colors.red : Colors.green),
                ),
              ),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: _checkFakeGps,
                child: const Text('Verificar GPS'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
135
points
12
downloads

Publisher

unverified uploader

Weekly Downloads

Faz detecção nativa de GPS falso no iPhone.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on detect_false_gps

Packages that implement detect_false_gps