getCurrentPosition method

Future<Position?> getCurrentPosition()

Implementation

Future<Position?> getCurrentPosition() async {
  final hasPermission = await _handlePermission();

  if (!hasPermission) {
    return null;
  }

  final isGpsEnabled = await _isGpsEnabled();

  if (!isGpsEnabled) {
    return null;
  }

  final position = await _geolocatorPlatform.getCurrentPosition();

  return position;
  // _updatePositionList(
  //   _PositionItemType.position,
  //   position.toString(),
  // );
}