getInstance<R> method

R getInstance<R>(
  1. dynamic data
)

Implementation

R getInstance<R>(data) {
  const reflector = Reflector();
  final ClassMirror mirror = reflector.reflectType(R) as ClassMirror;
  final instance = mirror.newInstance('fromJson', [data]);
  return instance as R;
}