currentLocation method

Future<AMapLocation?> currentLocation([
  1. bool needsAddress = false
])

Implementation

Future<AMapLocation?> currentLocation([bool needsAddress = false]) async {
  if (currentMapLocation == null) {
    await requestPermissionIfNeed();
    currentMapLocation = await aMapLocation.getLocation(needsAddress);
  }
  return currentMapLocation;
}