previousInstruction property
RouteInstruction?
get
previousInstruction
Previous route instruction on the route.
Returns the RouteInstruction immediately before the current navigation position. Returns null if unavailable (e.g., at the start of the route or if an error occurs).
Returns
- (RouteInstruction?) Previous route instruction, or null if not available.
See also:
- nextInstruction - Next instruction.
Implementation
RouteInstruction? get previousInstruction {
final OperationResult resultString = objectMethod(
pointerId,
'NavigationInstruction',
'getPreviousInstruction',
);
final GemError gemApiError = GemErrorExtension.fromCode(
resultString['gemApiError'],
);
if (gemApiError != GemError.success) {
return null;
}
return RouteInstruction.init(resultString['result']);
}