copyWith method

User copyWith({
  1. String? id,
  2. String? first_name,
  3. String? middle_name,
  4. String? last_name,
  5. String? mobile,
  6. String? email,
  7. String? national_id_number,
  8. String? passport_number,
  9. bool? is_superuser,
  10. String? role_id,
  11. String? referred_by,
  12. String? referee_id,
  13. String? referral_code,
  14. String? mobile_verified_at,
  15. String? email_verified_at,
  16. String? created_at,
  17. String? updated_at,
  18. String? corporate_name,
  19. String? corporate_reg_no,
  20. String? user_type_id,
  21. String? country_id,
  22. String? agent_type_ref,
  23. String? parent_ref,
  24. String? full_name,
  25. String? referrals_count,
})

Implementation

User copyWith({
  String? id,
  String? first_name,
  String? middle_name,
  String? last_name,
  String? mobile,
  String? email,
  String? national_id_number,
  String? passport_number,
  bool? is_superuser,
  String? role_id,
  String? referred_by,
  String? referee_id,
  String? referral_code,
  String? mobile_verified_at,
  String? email_verified_at,
  String? created_at,
  String? updated_at,
  String? corporate_name,
  String? corporate_reg_no,
  String? user_type_id,
  String? country_id,
  String? agent_type_ref,
  String? parent_ref,
  String? full_name,
  String? referrals_count,
}) {
  return User(
    id: id ?? this.id,
    first_name: first_name ?? this.first_name,
    middle_name: middle_name ?? this.middle_name,
    last_name: last_name ?? this.last_name,
    mobile: mobile ?? this.mobile,
    email: email ?? this.email,
    national_id_number: national_id_number ?? this.national_id_number,
    passport_number: passport_number ?? this.passport_number,
    is_superuser: is_superuser ?? this.is_superuser,
    role_id: role_id ?? this.role_id,
    referred_by: referred_by ?? this.referred_by,
    referee_id: referee_id ?? this.referee_id,
    referral_code: referral_code ?? this.referral_code,
    mobile_verified_at: mobile_verified_at ?? this.mobile_verified_at,
    email_verified_at: email_verified_at ?? this.email_verified_at,
    created_at: created_at ?? this.created_at,
    updated_at: updated_at ?? this.updated_at,
    corporate_name: corporate_name ?? this.corporate_name,
    corporate_reg_no: corporate_reg_no ?? this.corporate_reg_no,
    user_type_id: user_type_id ?? this.user_type_id,
    country_id: country_id ?? this.country_id,
    agent_type_ref: agent_type_ref ?? this.agent_type_ref,
    parent_ref: parent_ref ?? this.parent_ref,
    full_name: full_name ?? this.full_name,
    referrals_count: referrals_count ?? this.referrals_count,
  );
}