getValue<T> method
Retrieves a typed value for a specific form key.
Parameters:
key(FormKey<T>, required): The form key to look up.
Returns: T? — the value if found and correctly typed, null otherwise.
Implementation
T? getValue<T>(FormKey<T> key) {
Object? value = this[key];
if (value == null) {
return null;
}
assert(key.isInstanceOf(value),
'The value for key $key is not of type ${key.type}');
return value as T?;
}