asBeans<T> method

T? asBeans<T>(
  1. List<String> keys,
  2. dynamic toBean(
    1. Map<String, dynamic> json
    )
)

Implementation

T? asBeans<T>(List<String> keys, Function(Map<String, dynamic> json) toBean) {
  for (final String key in keys) {
    try {
      if (this[key] != null && _isClassBean(this[key])) {
        return toBean(this[key]);
      }
    } catch (e) {
      _print('json 解析异常,异常值:"$key":${this[key]}');
    }
  }

  return null;
}