isDefaultValue method

bool isDefaultValue(
  1. Object? instance
)

Determines whether the argument is a default value of this kind.

You can construct a default value with newInstance.

Implementation

bool isDefaultValue(Object? instance) {
  return instance is T &&
      equality.equals(
          instance, _expandoForDefaultValue[this] ??= newInstance());
}