Field constructor

Field({
  1. required FieldType type,
  2. required String name,
  3. required String alias,
  4. required int length,
  5. Domain? domain,
  6. required bool isEditable,
  7. required bool isNullable,
})

Creates a new field object with the following parameters.

Parameters:

  • type — Defines the type of field.
  • name — Name of the field.
  • alias — Alias of the field.
  • length — Length of the field.
  • domain — Domain for the field. Can be null.
  • isEditable — True if the field is editable.
  • isNullable — True if the field is nullable.

Implementation

factory Field({
  required FieldType type,
  required String name,
  required String alias,
  required int length,
  Domain? domain,
  required bool isEditable,
  required bool isNullable,
}) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreName = _CString(name);
  final coreAlias = _CString(alias);
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_Field_createWith(
      type.coreValue,
      coreName.bytes,
      coreAlias.bytes,
      length,
      domain?._handle ?? ffi.nullptr,
      isEditable,
      isNullable,
      errorHandler,
    );
  });
  final Field object = Field._withHandle(handle);
  object._domain.cache(domain);
  return object;
}