fromJson<T extends Object> static method

BKTEvaluationDetails<T> fromJson<T extends Object>(
  1. Map<String, dynamic> json, {
  2. TypeConverter<T>? converter,
})

Implementation

static BKTEvaluationDetails<T> fromJson<T extends Object>(
    Map<String, dynamic> json,
    {TypeConverter<T>? converter}) {
  final valueTypeConverter = converter ?? DefaultTypeConverter();
  return BKTEvaluationDetails<T>(
    featureId: json['featureId'],
    featureVersion: json['featureVersion'],
    userId: json['userId'],
    variationId: json['variationId'],
    variationName: json['variationName'],
    // throw exception if type does not match
    variationValue: valueTypeConverter.parse(json['variationValue']),
    reason: json['reason'],
  );
}