call<T> method

T call<T>(
  1. String key,
  2. T secondary
)

Implementation

T call<T>(String key, T secondary) {
  var root = this;
  if (root is Map<String, dynamic>) {
    var data = root[key];
    if (data is T) {
      return data;
    } else {
      return secondary;
    }
  } else {
    if (root is T) {
      return root;
    } else {
      return secondary;
    }
  }
}