disallowUnsafeConstructors property

bool disallowUnsafeConstructors

Implementation

static bool get disallowUnsafeConstructors => _disallowUnsafeConstructors;
void disallowUnsafeConstructors=(bool value)

Global configuration that specifies if unsafe constructors can be used or not. The default is false.

Implementation

static set disallowUnsafeConstructors(bool value) {
  if (_disallowUnsafeConstructors == value) return;
  if (ImmutableCollection.isConfigLocked)
    throw StateError("Can't change the configuration of immutable collections.");
  _disallowUnsafeConstructors = value;
}