read<T> method
Reads a value of type T
from field
in obj
.
Implementation
T read<T>(
Map<String, Object?> obj,
String field,
) {
final value = obj[field];
if (value is! T) {
throw DebugAdapterInvalidArgumentException(
requestName: request,
argumentName: field,
expectedType: T,
actualType: value.runtimeType,
actualValue: value,
);
}
return obj[field] as T;
}