ExperimentApiResponse.fromJson constructor

ExperimentApiResponse.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory ExperimentApiResponse.fromJson(Map<String, dynamic> json) {
  var experimentsList = (json['experiments'] as List)
      .map((exp) => UserExperimentVariant.fromJson(exp))
      .toList();

  return ExperimentApiResponse(
    userType: json['userType'],
    experiments: experimentsList,
  );
}