updateBezierCurve method

Future<void> updateBezierCurve({
  1. required String curveId,
  2. OlaLatLng? startPoint,
  3. OlaLatLng? endPoint,
  4. String? color,
  5. String? lineType,
  6. double? width,
})

Update bezier curve properties

Implementation

Future<void> updateBezierCurve({
  required String curveId,
  OlaLatLng? startPoint,
  OlaLatLng? endPoint,
  String? color,
  String? lineType,
  double? width,
}) async {
  try {
    final args = <String, dynamic>{'curveId': curveId};
    if (startPoint != null) {
      args['startLatitude'] = startPoint.latitude;
      args['startLongitude'] = startPoint.longitude;
    }
    if (endPoint != null) {
      args['endLatitude'] = endPoint.latitude;
      args['endLongitude'] = endPoint.longitude;
    }
    if (color != null) {
      args['color'] = color;
    }
    if (lineType != null) {
      args['lineType'] = lineType;
    }
    if (width != null) {
      args['width'] = width;
    }
    await _channel.invokeMethod('updateBezierCurve', args);
  } catch (e) {
    debugPrint('Error updating bezier curve: $e');
  }
}