loadJson<T extends Store> method

T loadJson<T extends Store>(
  1. Map<String, dynamic> from,
  2. T to
)

Implementation

T loadJson<T extends Store>(Map<String, dynamic> from, T to) {
  for (var MapEntry(key: fieldName, value: nextTo) in to.fields.entries) {
    // 字段未发现数据则跳过
    if (!from.containsKey(fieldName)) {
      continue;
    }
    var nextFrom = from[fieldName];
    _loadField(to, fieldName, nextFrom, nextTo);
  }
  return to;
}