modelDecode<T> function

T modelDecode<T>(
  1. dynamic data
)

Implementation

T modelDecode<T>(dynamic data) {
  if (data is List) {
    return data.convert<T>();
  }

  if (_factories.containsKey(T)) {
    return _factories[T](data);
  }

  throw UnsupportedError('unsupported type');
}