addCircle method
Implementation
Future<ShapeId> addCircle({
required GeoPoint center,
required double radius,
required Color color,
Color? borderColor,
double strokeWidth = 1,
ShapeId? shapeId,
}) async {
if (!radius.isFinite ||
radius <= 0 ||
!strokeWidth.isFinite ||
strokeWidth <= 0) {
throw _argumentException(_controller, 'addCircle', 'invalid_shape');
}
final id = _issue(shapeId, 'addCircle');
try {
final transport = await _controller._readyTransport();
await transport.addCircle(
shapeId: id,
center: center,
radius: radius,
fillColor: _signedArgb(color),
borderColor: _signedArgb(borderColor ?? color),
strokeWidth: strokeWidth,
);
return id;
} catch (_) {
_issuedIds.remove(id);
rethrow;
}
}