Path.fromCoordinates constructor

Path.fromCoordinates(
  1. List<Coordinates> coords
)

Create a path from a list of coordinates.

Creates a Path from a list of Coordinates.

This is the most convenient constructor when you already have the coordinates available.

Parameters

  • coords: The ordered list of Coordinates that make up the path.

Implementation

factory Path.fromCoordinates(final List<Coordinates> coords) {
  final String resultString = GemKitPlatform.instance.callCreateObject(
    jsonEncode(<String, Object>{
      'class': 'Path',
      'args': <String, dynamic>{'coords': coords},
    }),
  );
  final dynamic decodedVal = jsonDecode(resultString);

  return Path.init(decodedVal['result']);
}