fromMap static method

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

Implementation

static TSelectionEntity fromMap(Map<String, dynamic> map) {
  TSelectionEntity entity = TSelectionEntity();
  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']) ??
        TSelectionConstant.maxSelectCount;
  } else {
    entity.maxSelectedCount = TSelectionConstant.maxSelectCount;
  }
  entity.extMap = map['ext'] ?? {};
  if (map['children'] != null && map['children'] is List) {
    entity.children = [...(map['children'] as List).map((o) => TSelectionEntity.fromMap(o))];
  }
  entity.filterType = entity.parserFilterTypeWithType(map['type'] ?? "");
  return entity;
}