shareTripById function

Future<ShareTripResponse?> shareTripById(
  1. String appTripId,
  2. String countryCode,
  3. String phoneNumber
)

Implementation

Future<ShareTripResponse?> shareTripById(
    String appTripId,
    String countryCode,
    String phoneNumber,
    ) async {
  try {
    String? result = await platform.invokeMethod('shareTripById', {
      "appTripId": appTripId,
      "countryCode": countryCode,
      "phoneNumber": phoneNumber,
    });
    if (kDebugMode) {
      print("Received Shared Trip Detains from sdk: $shareTripById");
    }
    return ShareTripResponse.fromJson(jsonDecode(result!));
  } on PlatformException catch (e, stacktrace) {
    if (kDebugMode) {
      print("Error in shareTripById");
      print(e);
      print(stacktrace);
    }
    rethrow;
  } catch (e, stacktrace) {
    if (kDebugMode) {
      print("Error in shareTripById");
      print(e);
      print(stacktrace);
    }
    throw PlatformException(code: "PLUGIN_ERROR", message: e.toString());
  }
}