PluralTranslation.fromJson constructor

PluralTranslation.fromJson({
  1. required Map<String, dynamic> json,
})

Implementation

factory PluralTranslation.fromJson({required Map<String, dynamic> json}) {
  return PluralTranslation(
    original: json['original'] as String,
    argument: json['argument'] as String,
    other: Translation.fromJson(json: json['other']) ??
        SimpleTranslation(
          original: '',
          elements: [],
        ),
    zero: json['zero'] != null
        ? Translation.fromJson(json: json['zero'])
        : null,
    one: json['one'] != null ? Translation.fromJson(json: json['one']) : null,
    two: json['two'] != null ? Translation.fromJson(json: json['two']) : null,
    few: json['few'] != null ? Translation.fromJson(json: json['few']) : null,
    many: json['many'] != null
        ? Translation.fromJson(json: json['many'])
        : null,
  );
}