dataType<T> method

T dataType<T>(
  1. String key, {
  2. T? def,
})

Retrieves the value associated with key from the request data, cast to type T.

Implementation

T dataType<T>(String key, {T? def}) {
  var map = getAllData();
  T res = map[key] ?? def;
  return res;
}