copyWith method
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,
复制并更新部分字段
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,
);
}