VisionPoint.fromMap constructor

VisionPoint.fromMap(
  1. Map<Object?, Object?> map
)

Implementation

factory VisionPoint.fromMap(Map<Object?, Object?> map) {
  final x = map['x'];
  final y = map['y'];
  if (x is! num || y is! num) {
    throw const FormatException('A vision point requires numeric x and y.');
  }
  return VisionPoint(x.toDouble(), y.toDouble());
}