Path constructor

Path({
  1. List<Coordinates> coordinates = const <Coordinates>[],
  2. List<int> waypoints = const <int>[],
  3. String name = '',
})

Creates a Path from a list of coordinates and waypoints, with an optional name.

Parameters

  • coordinates: The list of Coordinates defining the path. Defaults to an empty list.
  • waypoints: A list of integer indices referencing positions in coordinates. Defaults to an empty list.
  • name: An optional human readable name for the path. Defaults to an empty string.

Returns

  • A new Path instance containing the provided coordinates, waypoints, and name

Implementation

factory Path({
  final List<Coordinates> coordinates = const <Coordinates>[],
  final List<int> waypoints = const <int>[],
  final String name = '',
}) {
  final Path path = Path.fromCoordinatesWaypoints(
    coordinates: coordinates,
    waypoints: waypoints,
  );
  path.name = name;
  return path;
}