getDrivingBehaviourScoreChange function

Future<DrivingBehaviourScoreChange?> getDrivingBehaviourScoreChange(
  1. KruzrPerioicType kruzrPeriodicType
)

Implementation

Future<DrivingBehaviourScoreChange?> getDrivingBehaviourScoreChange(
    KruzrPerioicType kruzrPeriodicType,
    ) async {
  try {
    String? drivingBehaviourScoreChange = await platform.invokeMethod(
      'getDrivingBehaviourScoreChange',
      {'kruzrPeriodicType': kruzrPeriodicType.value},
    );
    if (kDebugMode) {
      print(
        "Received DrivingBehaviourScoreChange from sdk: $drivingBehaviourScoreChange",
      );
    }
    return DrivingBehaviourScoreChange.fromJson(
      jsonDecode(drivingBehaviourScoreChange!),
    );
  } on PlatformException catch (e, stacktrace) {
    if (kDebugMode) {
      print("Error in getDrivingBehaviourScoreChange");
      print(e);
      print(stacktrace);
    }
    rethrow;
  } catch (e, stacktrace) {
    if (kDebugMode) {
      print("Error in getDrivingBehaviourScoreChange");
      print(e);
      print(stacktrace);
    }
    throw PlatformException(code: "PLUGIN_ERROR", message: e.toString());
  }
}