getPreferences method

RoutePreferences? getPreferences(
  1. int index
)

Retrieves the RoutePreferences saved with the route at index.

Parameters

  • index: Index of the route in the current sort order.

Returns

  • RoutePreferences?: preferences when present, otherwise null.

Implementation

RoutePreferences? getPreferences(final int index) {
  final OperationResult resultString = objectMethod(
    pointerId,
    'RouteBookmarks',
    'getPreferences',
    args: index,
  );

  final GemError err = GemErrorExtension.fromCode(
    resultString.data['gemApiError'],
  );

  if (err != GemError.success) {
    return null;
  }

  return RoutePreferences.fromJson(resultString.data['result']);
}