$custom<T> static method

T? $custom<T>(
  1. dynamic json,
  2. String key,
  3. ElSerialize<T> model
)

当内置的数据转换不满足目标类型时,将统一进入自定义序列化方法, 如果用户没有提供自定义序列化,那么程序将抛出异常

Implementation

static T? $custom<T>(dynamic json, String key, ElSerialize<T> model) {
  final value = _getJsonValue(json, key);
  if (value == null) return null;
  return model.deserialize(value);
}