toPTRoute method

PTRoute? toPTRoute()

Convert to a PTRoute from this one.

Returns

  • PTRoute object if the route is a public transport route, null otherwise

Throws

  • An exception if it fails.

Implementation

PTRoute? toPTRoute() {
  final OperationResult resultString = objectMethod(
    _pointerId,
    'Route',
    'toPTRoute',
  );

  if (resultString['result'] == 0) {
    return null;
  }
  return PTRoute.init(resultString['result'], 0);
}