isExpressionExactlyType function

bool isExpressionExactlyType(
  1. Expression expression,
  2. String typeName,
  3. String packageName
)

Implementation

bool isExpressionExactlyType(
  Expression expression,
  String typeName,
  String packageName,
) {
  if (expression.staticType case final type?) {
    return TypeChecker.fromName(
      typeName,
      packageName: packageName,
    ).isExactlyType(type);
  }
  return false;
}