CodedValueDescription constructor

CodedValueDescription({
  1. required String name,
  2. required dynamic value,
})

Creates a new coded value description object with the specified name and value.

Parameters:

  • name — The coded value's name.
  • value — The coded value's value.

Implementation

factory CodedValueDescription({
  required String name,
  required dynamic value,
}) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreName = _CString(name);
  final coreValue = _ElementExtension.fromDartValue(value);
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_CodedValueDescription_createWithNameAndValue(
      coreName.bytes,
      coreValue._handle,
      errorHandler,
    );
  });
  final CodedValueDescription object =
      CodedValueDescription._withHandle(handle);
  object._value.cache(value);
  return object;
}