getTypedList<T> method

List<T>? getTypedList<T>(
  1. String key, {
  2. T factory(
    1. dynamic v
    )?,
})
inherited

Returns the property key as a typed list

Implementation

List<T>? getTypedList<T>(String key, {T Function(dynamic v)? factory}) {
  return _typedMap.putIfAbsent(key, () {
    var v = this[key];
    if (v == null) return null;

    if (v is List) {
      return List<T>.unmodifiable(
          v.map((i) => _convert(i, factory: factory)));
    }

    return List<T>.unmodifiable([_convert(v, factory: factory)]);
  });
}