matchValueTypeByName static method

bool matchValueTypeByName(
  1. String expectedType,
  2. dynamic actualValue
)

Matches expected type to a type of a value.

  • expectedType an expected type name to match.
  • actualValue a value to match its type to the expected one. Returns true if types are matching and false if they don't.

Implementation

static bool matchValueTypeByName(String expectedType, actualValue) {
  // if (expectedType == null) return true;
  // if (actualValue == null) throw Exception('Actual value cannot be null');

  return matchTypeByName(expectedType, TypeConverter.toTypeCode(actualValue));
}