nextInstruction property
Next route instruction on the route.
Returns the RouteInstruction following the current navigation position. Returns null if unavailable (e.g., when at the destination or if an error occurs).
Returns
- (RouteInstruction?) Next route instruction, or null if not available.
See also:
- nextNextInstruction - Instruction after the next one.
- previousInstruction - Previous instruction.
- hasNextTurnInfo - Check for immediate next turn info.
Implementation
RouteInstruction? get nextInstruction {
final OperationResult resultString = objectMethod(
pointerId,
'NavigationInstruction',
'getNextInstruction',
);
final GemError gemApiError = GemErrorExtension.fromCode(
resultString['gemApiError'],
);
if (gemApiError != GemError.success) {
return null;
}
return RouteInstruction.init(resultString['result']);
}