copyWith method

UserProfileModel copyWith({
  1. int? id,
  2. String? userId,
  3. String? gender,
  4. int? heightCm,
  5. double? weightKg,
  6. int? bustCm,
  7. int? waistCm,
  8. int? hipsCm,
  9. String? fitPreference,
  10. List<String>? stylePreferenceTags,
  11. List<String>? colorPreferenceTags,
  12. String? avoidElements,
  13. Map<String, dynamic>? userProfileData,
  14. String? sceneTag,
  15. double? bmi,
  16. double? waistHipRatio,
  17. String? createdAt,
  18. String? updatedAt,
})

复制并更新部分字段

Implementation

UserProfileModel copyWith({
  int? id,
  String? userId,
  String? gender,
  int? heightCm,
  double? weightKg,
  int? bustCm,
  int? waistCm,
  int? hipsCm,
  String? fitPreference,
  List<String>? stylePreferenceTags,
  List<String>? colorPreferenceTags,
  String? avoidElements,
  Map<String, dynamic>? userProfileData,
  String? sceneTag,
  double? bmi,
  double? waistHipRatio,
  String? createdAt,
  String? updatedAt,
}) {
  return UserProfileModel(
    id: id ?? this.id,
    userId: userId ?? this.userId,
    gender: gender ?? this.gender,
    heightCm: heightCm ?? this.heightCm,
    weightKg: weightKg ?? this.weightKg,
    bustCm: bustCm ?? this.bustCm,
    waistCm: waistCm ?? this.waistCm,
    hipsCm: hipsCm ?? this.hipsCm,
    fitPreference: fitPreference ?? this.fitPreference,
    stylePreferenceTags: stylePreferenceTags ?? this.stylePreferenceTags,
    colorPreferenceTags: colorPreferenceTags ?? this.colorPreferenceTags,
    avoidElements: avoidElements ?? this.avoidElements,
    userProfileData: userProfileData ?? this.userProfileData,
    sceneTag: sceneTag ?? this.sceneTag,
    bmi: bmi ?? this.bmi,
    waistHipRatio: waistHipRatio ?? this.waistHipRatio,
    createdAt: createdAt ?? this.createdAt,
    updatedAt: updatedAt ?? this.updatedAt,
  );
}