suggest method

Future<List<SuggestResult>> suggest({
  1. required String searchText,
  2. SuggestParameters? parameters,
})

Suggest address with parameters and returns possible variants.

Geocoding suggestions provide a mechanism for implementing character-by-character auto-complete. Using a text input and optional SuggestParameters, suggested addresses can be quickly found and presented to the user. Suggestions are not limited to addresses, they can also be used for POIs (Points of Interest). To return a focused set of suggestions, set the SuggestParameters.preferredSearchLocation or the SuggestParameters.searchArea. Using the SuggestParameters.preferredSearchLocation is similar to how ArcGIS Pro limits the suggestions returned.

Parameters:

  • searchText — Part of address text.
  • parameters — Suggest method parameters.

Return Value: A Future returning a List of SuggestResult

Implementation

Future<List<SuggestResult>> suggest({
  required String searchText,
  SuggestParameters? parameters,
}) {
  final coreSearchText = _CString(searchText);
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_LocatorTask_suggestCombined(
      _handle,
      coreSearchText.bytes,
      parameters?._handle ?? ffi.nullptr,
      errorHandler,
    );
  });
  return taskHandle.toFuture(
    (element) => element.getValueAsList()!,
  );
}