Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save martinoyovo/4e6fc8cbd6ce9e1386432e5fc4aed305 to your computer and use it in GitHub Desktop.

Select an option

Save martinoyovo/4e6fc8cbd6ce9e1386432e5fc4aed305 to your computer and use it in GitHub Desktop.
class _ShowDeviceLocation extends State<ShowDeviceLocation> with WidgetsBindingObserver {
...
@override
void initState() {
// Add the app lifecycle observer.
WidgetsBinding.instance.addObserver(this);
if (_locationPermission != AppPermissionStatus.granted) {
initLocationPermissions();
}
super.initState();
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment