tryData<T> method
Retrieves the value of key
as a String from the request data.
If the value is not found, returns def
(default value).
This method is used to retrieve string values from the request data.
Implementation
T? tryData<T>(String key, {T? def}) {
if (hasData(key)) {
return get<T>(key, def: def);
} else {
return def;
}
}