FeatureBean.fromJson constructor

FeatureBean.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory FeatureBean.fromJson(Map<String, Object?> json) {
  return FeatureBean(
    boardFeature: json[r'boardFeature'] != null
        ? FeatureBeanBoardFeature.fromValue(json[r'boardFeature']! as String)
        : null,
    boardId: (json[r'boardId'] as num?)?.toInt(),
    state: json[r'state'] != null
        ? FeatureBeanState.fromValue(json[r'state']! as String)
        : null,
    localisedName: json[r'localisedName'] as String?,
    localisedDescription: json[r'localisedDescription'] as String?,
    learnMoreLink: json[r'learnMoreLink'] as String?,
    imageUri: json[r'imageUri'] as String?,
    featureType: json[r'featureType'] != null
        ? FeatureBeanFeatureType.fromValue(json[r'featureType']! as String)
        : null,
    localisedGroup: json[r'localisedGroup'] as String?,
    permissibleEstimationTypes: (json[r'permissibleEstimationTypes']
                as List<Object?>?)
            ?.map((i) => FeatureBeanPermissibleEstimationTypesItem.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    featureId: json[r'featureId'] as String?,
    learnMoreArticleId: json[r'learnMoreArticleId'] as String?,
    toggleLocked: json[r'toggleLocked'] as bool? ?? false,
  );
}