toPTRoute method
Converts this route to a PTRoute when applicable.
Returns a PTRoute exposing public-transport-specific functionality when this route is a PT route. Returns
null otherwise.
Returns
- A PTRoute when this route is a public transport route, or
nullif it is not.
Also see:
- isPTRoute - Check whether this route is a PT route.
Implementation
PTRoute? toPTRoute() {
final OperationResult resultString = objectMethod(
super.pointerId,
'Route',
'toPTRoute',
);
if (resultString['result'] == -1) {
return null;
}
return PTRoute.init(resultString['result']);
}