fromMap static method

SelectionEntity fromMap(
  1. Map<String, dynamic> map
)

建议使用 BrnSelectionEntity.fromJson

Implementation

static SelectionEntity fromMap(Map<String, dynamic> map) {
  SelectionEntity entity = SelectionEntity();
  entity.title = map['title'] ?? '';
  entity.subTitle = map['subTitle'] ?? '';
  entity.key = map['key'] ?? '';
  entity.type = map['type'] ?? '';
  entity.defaultValue = map['defaultValue'] ?? "";
  entity.value = map['value'] ?? "";
  if (map['maxSelectedCount'] != null &&
      int.tryParse(map['maxSelectedCount']) != null) {
    entity.maxSelectedCount = int.tryParse(map['maxSelectedCount']) ??
        SelectionConstant.maxSelectCount;
  } else {
    entity.maxSelectedCount = SelectionConstant.maxSelectCount;
  }
  entity.extMap = map['ext'] ?? {};
  if (map['children'] != null && map['children'] is List) {
    entity.children = []..addAll(
        (map['children'] as List).map((o) => SelectionEntity.fromMap(o)));
  }
  entity.filterType = entity.parserFilterTypeWithType(map['type'] ?? "");
  return entity;
}