nextInstruction property

RouteInstruction? get nextInstruction

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:

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']);
}