callDistanceMatrix method

Future<DistanceResponse?> callDistanceMatrix()

Implementation

Future<DistanceResponse?> callDistanceMatrix() async {
  try {
    String? result = await restApi.distanceMatrix(toMap());
    return result != null
        ? DistanceResponse.fromMap(json.decode(result))
        : null;
  } on PlatformException catch (e) {
    return Future.error(e);
  }
}