search static method
      
TaskHandler?
search(
    
- String textFilter,
 - Coordinates referenceCoordinates,
 - void onComplete(), {
 - SearchPreferences? preferences,
 - RectangleGeographicArea? locationHint,
 
Search using text and geographic area as discriminants.
Parameters
- IN textFilter The text filter.
 - IN referenceCoordinates The reference position. Results will be relevant to this position.
 - IN onComplete Will be invoked when the search operation is completed, providing the search results and an error code.
- GemError.success and a non-empty list of landmarks if the search was successfully completed
 - GemError.reducedResult and a non-empty list of landmarks if the search was successfully completed but only a subset of results were returned
 - GemError.invalidInput if the search input is invalid, e.g. referenceCoordinates are invalids
 - GemError.cancel if the search was canceled by the user
 - GemError.noMemory if the search engine couldn't allocate the necessary memory for the operation
 - GemError.operationTimeout if the search was executed on the online service and the operation took too much time to complete ( usually more than 1 min, depending on the server overload state )
 - GemError.networkFailed if the search was executed on the online service and the operation failed due to bad network connection
 
 - IN preferences The search preferences. Optional.
 - IN locationHint The location hint. The search will be restricted to the provided geographic area. Optional.
 
Returns
- Associated TaskHandler for this operation if the search can be started otherwise null.
 
Implementation
static TaskHandler? search(
  final String textFilter,
  final Coordinates referenceCoordinates,
  final void Function(GemError err, List<Landmark> results) onComplete, {
  SearchPreferences? preferences,
  final RectangleGeographicArea? locationHint,
}) {
  preferences ??= SearchPreferences();
  final EventDrivenProgressListener progListener =
      EventDrivenProgressListener();
  GemKitPlatform.instance.registerEventHandler(progListener.id, progListener);
  final LandmarkList results = LandmarkList();
  progListener.registerOnCompleteWithData((
    final int err,
    final String hint,
    final Map<dynamic, dynamic> json,
  ) {
    GemKitPlatform.instance.unregisterEventHandler(progListener.id);
    if (err == GemError.success.code || err == GemError.reducedResult.code) {
      onComplete(GemErrorExtension.fromCode(err), results.toList());
    } else {
      onComplete(GemErrorExtension.fromCode(err), <Landmark>[]);
    }
  });
  final OperationResult resultString = staticMethod(
    'SearchService',
    'search',
    args: <String, dynamic>{
      'results': results.pointerId,
      'listener': progListener.id,
      'textFilter': textFilter,
      'referenceCoordinates': referenceCoordinates,
      'preferences': preferences.pointerId,
      'locationHint':
          locationHint ??
          RectangleGeographicArea(
            topLeft: Coordinates(),
            bottomRight: Coordinates(),
          ),
    },
  );
  final GemError errorCode = GemErrorExtension.fromCode(
    resultString['result'],
  );
  if (errorCode != GemError.success) {
    onComplete(errorCode, <Landmark>[]);
    return null;
  }
  return TaskHandlerImpl(progListener.id);
}