copyWith method

CountryData copyWith({
  1. String? id,
  2. String? code,
  3. String? name,
  4. String? nameInEnglish,
  5. String? countryCode,
  6. String? isoCode2,
  7. String? isoCode3,
  8. int? population,
  9. int? area,
  10. Value<double?> gdp = const Value.absent(),
  11. Value<String?> description = const Value.absent(),
})

Implementation

CountryData copyWith({
  String? id,
  String? code,
  String? name,
  String? nameInEnglish,
  String? countryCode,
  String? isoCode2,
  String? isoCode3,
  int? population,
  int? area,
  Value<double?> gdp = const Value.absent(),
  Value<String?> description = const Value.absent(),
}) => CountryData(
  id: id ?? this.id,
  code: code ?? this.code,
  name: name ?? this.name,
  nameInEnglish: nameInEnglish ?? this.nameInEnglish,
  countryCode: countryCode ?? this.countryCode,
  isoCode2: isoCode2 ?? this.isoCode2,
  isoCode3: isoCode3 ?? this.isoCode3,
  population: population ?? this.population,
  area: area ?? this.area,
  gdp: gdp.present ? gdp.value : this.gdp,
  description: description.present ? description.value : this.description,
);