copyWith method

Surah copyWith({
  1. int? id,
  2. String? name,
  3. String? englishName,
  4. String? revelationType,
  5. int? numberOfAyahs,
  6. int? revelationOrder,
  7. List<Ayah>? ayat,
  8. String? source,
})

Creates a copy of this Surah with the given fields replaced with new values

Implementation

Surah copyWith({
  int? id,
  String? name,
  String? englishName,
  String? revelationType,
  int? numberOfAyahs,
  int? revelationOrder,
  List<Ayah>? ayat,
  String? source,
}) {
  return Surah(
    id: id ?? this.id,
    name: name ?? this.name,
    englishName: englishName ?? this.englishName,
    revelationType: revelationType ?? this.revelationType,
    numberOfAyahs: numberOfAyahs ?? this.numberOfAyahs,
    revelationOrder: revelationOrder ?? this.revelationOrder,
    ayat: ayat ?? this.ayat,
    source: source ?? this.source,
  );
}