fromJson method

dynamic fromJson(
  1. dynamic value,
  2. TypeContext context
)
override

Implementation

fromJson(value, TypeContext context) {
  if (value == null) return null;
  var to = context.typeInfo.createInstance();
  Map? map = value is Map ? value : null;
  if (map != null) {
    if (map.length == 0) return null;

    map.forEach((key, val) => to.key = val);
  }
  return to;
}