InteractiveOverlayImage.safe constructor

InteractiveOverlayImage.safe({
  1. Key? key,
  2. required ImageProvider<Object> image,
  3. required LatLng topLeft,
  4. required LatLng topRight,
  5. required LatLng bottomRight,
  6. required LatLng bottomLeft,
  7. int alpha = 220,
  8. double? handleSize,
  9. List<OverlayOptions> options = const [],
})

Creates an InteractiveOverlayImage performing checks on options.

Keeps named arguments for convenience, but stores them in corners.

Implementation

factory InteractiveOverlayImage.safe({
  Key? key,
  required ImageProvider image,
  required LatLng topLeft,
  required LatLng topRight,
  required LatLng bottomRight,
  required LatLng bottomLeft,
  int alpha = 220,
  double? handleSize,
  List<OverlayOptions> options = const [],
}) {
  _debugAssertNoDuplicateOptionTypes(options);
  return InteractiveOverlayImage(
    key: key,
    image: image,
    corners: QuadLatLng(
      topLeft: topLeft,
      topRight: topRight,
      bottomRight: bottomRight,
      bottomLeft: bottomLeft,
    ),
    alpha: alpha,
    handleSize: handleSize,
    options: List<OverlayOptions>.unmodifiable(options),
  );
}