containsAsType<T> method
Checks if this array contains a value. The check before comparison converts elements and the value to type specified by type code.
- typeCode a type code that defines a type to convert values before comparison
value
a value to be checked Returns true if this array contains the value or false otherwise.
Implementation
bool containsAsType<T>(TypeCode typeCode, dynamic value) {
var typedValue = TypeConverter.toType<T>(typeCode, value);
for (var index = 0; index < _values.length; index++) {
var thisTypedValue =
TypeConverter.toNullableType(typeCode, _values[index]);
if (typedValue == null && thisTypedValue == null) return true;
if (typedValue == null || thisTypedValue == null) continue;
if (typedValue == thisTypedValue) return true;
}
return false;
}