UniqueValue constructor

UniqueValue(
  1. {String description = '',
  2. String label = '',
  3. ArcGISSymbol? symbol,
  4. List<Object> values = const []}
)

Creates a new unique value (or unique combination of values) and a symbol used to display elements with this value in an UniqueValueRenderer.

Parameters:

  • description — A description of the unique value. "Parcels zoned for residential use", for example.
  • label — A label for the unique value. "Residential", for example.
  • symbol — A symbol used to represent elements with this unique value.
  • values — A List containing dynamic types that define a unique value or unique combination of values.

Implementation

factory UniqueValue(
    {String description = '',
    String label = '',
    ArcGISSymbol? symbol,
    List<Object> values = const []}) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreDescription = _CString(description);
  final coreLabel = _CString(label);
  final coreValues = values.toMutableArray(valueType: _ElementType.variant);
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_UniqueValue_createWith(
        coreDescription.bytes,
        coreLabel.bytes,
        symbol?._handle ?? ffi.nullptr,
        coreValues._handle,
        errorHandler);
  });
  final UniqueValue object = UniqueValue._instanceCache.instanceWith(handle);
  object._symbol.cache(symbol);
  object._values.value.setCache(values);
  return object;
}