getCurrentLocation method

  1. @override
Future<CoffeeBackgroundLocation?> getCurrentLocation()
override

Implementation

@override
Future<CoffeeBackgroundLocation?> getCurrentLocation() async {
  try {
    final result = await methodChannel.invokeMethod('getCurrentLocation');

    if (result == null) {
      return null;
    }

    final map = Map<String, dynamic>.from(result);
    return CoffeeBackgroundLocation.fromMap(map);
  } catch (e) {
    return null;
  }
}