shareTrip function

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

Implementation

Future<ShareTripResponse?> shareTrip(
  String appTripId,
  String countryCode,
  String phoneNumber,
) async {
  try {
    String? result = await platform.invokeMethod('shareTripWith', {
      "appTripId": appTripId,
      "countryCode": countryCode,
      "phoneNumber": phoneNumber,
    });
    if (kDebugMode) {
      print("Received Shared Trip Detains from sdk: $shareTrip");
    }
    return ShareTripResponse.fromJson(jsonDecode(result!));
  } catch (e, stacktrace) {
    if (kDebugMode) {
      print("Error in shareTrip");
      print(e);
      print(stacktrace);
    }
    return null;
  }
}