getAlert method

PTAlert? getAlert(
  1. int index
)

Get alert by index.

Parameters

  • index: Zero-based index of the alert to retrieve.

Returns

  • PTAlert?: The alert object, or null when the index is out of bounds.

See also:

  • countAlerts - get the number of alerts in the route segment.

Implementation

PTAlert? getAlert(final int index) {
  final OperationResult resultString = objectMethod(
    pointerId,
    'PTRouteSegment',
    'getAlert',
    args: <String, int>{'index': index},
  );

  if (resultString['result'] == -1) {
    return null;
  }

  return PTAlert(resultString['result']);
}