Skip to content

Instantly share code, notes, and snippets.

@arulwastaken
Created April 2, 2021 10:27
Show Gist options
  • Save arulwastaken/759dbb62c215df75286cc482ff1ca8a6 to your computer and use it in GitHub Desktop.
Save arulwastaken/759dbb62c215df75286cc482ff1ca8a6 to your computer and use it in GitHub Desktop.
Consume of location manager flutter
LocationManager(callback: (state) {
print("State ${state.toString()}");
switch(state.state) {
case LocationEnum.ERROR:
print("error ${state.message}");
break;
case LocationEnum.LOADING:
// TODO: Handle this case.
break;
case LocationEnum.REQUESTING_LOCATION_SERVICE:
// TODO: Handle this case.
break;
case LocationEnum.REQUESTING_LOCATION_PERMISSION:
// TODO: Handle this case.
break;
case LocationEnum.LOCATION_FOUND:
// TODO: Handle this case.
break;
}
}).requestLocation();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment