ManualDisplayFilterDefinition.withFilters constructor

ManualDisplayFilterDefinition.withFilters({
  1. DisplayFilter? activeFilter,
  2. required List<DisplayFilter> availableFilters,
})

Creates a new ManualDisplayFilterDefinition with the specified active and available filters.

To enable display filter on a layer, specify a filter that is part of ManualDisplayFilterDefinition.availableFilters. If the provided DisplayFilter isn't part of the available filters, the ManualDisplayFilterDefinition.activeFilter property will remain null.

Parameters:

Implementation

factory ManualDisplayFilterDefinition.withFilters({
  DisplayFilter? activeFilter,
  required List<DisplayFilter> availableFilters,
}) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreAvailableFilters = availableFilters.toMutableArray(
    valueType: _ElementType.displayFilter,
  );
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_ManualDisplayFilterDefinition_createWithFilters(
      activeFilter?._handle ?? ffi.nullptr,
      coreAvailableFilters._handle,
      errorHandler,
    );
  });
  final ManualDisplayFilterDefinition object =
      ManualDisplayFilterDefinition._withHandle(handle);
  object._activeFilter.cache(activeFilter);
  object._availableFilters.value.setCache(availableFilters);
  return object;
}