get<T> method
Returns the JSON value of the parameter named key.
Throws a StateError if the value isn't a T.
Implementation
T get<T>(String key) {
final value = _params[key];
if (value is! T) {
throw StateError('$key is not $T: $value');
}
return value;
}