getCurrentLocation method

Future<LocationDto> getCurrentLocation()

Get the current location.

Implementation

Future<LocationDto> getCurrentLocation() async {
  if (!await BackgroundLocator.isRegisterLocationUpdate()) {
    await start();
    LocationDto dto = await locationStream.first;
    stop();
    return dto;
  }
  return await locationStream.first;
}