Skip to content

Instantly share code, notes, and snippets.

@manofi21
Created June 2, 2023 04:11
Show Gist options
  • Save manofi21/2d37439c59627a3fddfa8b45ffb067ff to your computer and use it in GitHub Desktop.
Save manofi21/2d37439c59627a3fddfa8b45ffb067ff to your computer and use it in GitHub Desktop.
Check posisi user apakah melakukan mocked atau tidak.

pake Geolocator bisa https://pub.dev/packages/geolocator

// Get current position with desired accuracy
Position position = await Geolocator.getCurrentPosition(
  desiredAccuracy: LocationAccuracy.best,
);

// Detect mock location and handle it
if (position.isMocked) {
  // do things here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment