feat: Add sharePadSupplies setting and update SharingSettingsScreen
- Add sharePadSupplies field to UserProfile model (HiveField 58) - Update SharingSettingsScreen: Pad Supplies toggle disabled when pad tracking off - Update SharingSettingsScreen: Intimacy sharing always enabled (it's their husband) - Regenerate Hive adapters
This commit is contained in:
@@ -316,6 +316,9 @@ class UserProfile extends HiveObject {
|
|||||||
@HiveField(57)
|
@HiveField(57)
|
||||||
String? partnerId; // ID of the partner to sync with
|
String? partnerId; // ID of the partner to sync with
|
||||||
|
|
||||||
|
@HiveField(58, defaultValue: true)
|
||||||
|
bool sharePadSupplies; // Share pad supply data with partner
|
||||||
|
|
||||||
UserProfile({
|
UserProfile({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.name,
|
required this.name,
|
||||||
@@ -374,6 +377,7 @@ class UserProfile extends HiveObject {
|
|||||||
this.husbandAccentColor = '0xFF1A3A5C',
|
this.husbandAccentColor = '0xFF1A3A5C',
|
||||||
this.useExampleData = false,
|
this.useExampleData = false,
|
||||||
this.partnerId,
|
this.partnerId,
|
||||||
|
this.sharePadSupplies = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// Check if user is married
|
/// Check if user is married
|
||||||
@@ -457,6 +461,7 @@ class UserProfile extends HiveObject {
|
|||||||
String? husbandAccentColor,
|
String? husbandAccentColor,
|
||||||
bool? useExampleData,
|
bool? useExampleData,
|
||||||
String? partnerId,
|
String? partnerId,
|
||||||
|
bool? sharePadSupplies,
|
||||||
}) {
|
}) {
|
||||||
return UserProfile(
|
return UserProfile(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
@@ -519,6 +524,7 @@ class UserProfile extends HiveObject {
|
|||||||
husbandAccentColor: husbandAccentColor ?? this.husbandAccentColor,
|
husbandAccentColor: husbandAccentColor ?? this.husbandAccentColor,
|
||||||
useExampleData: useExampleData ?? this.useExampleData,
|
useExampleData: useExampleData ?? this.useExampleData,
|
||||||
partnerId: partnerId ?? this.partnerId,
|
partnerId: partnerId ?? this.partnerId,
|
||||||
|
sharePadSupplies: sharePadSupplies ?? this.sharePadSupplies,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,13 +124,14 @@ class UserProfileAdapter extends TypeAdapter<UserProfile> {
|
|||||||
fields[55] == null ? '0xFF1A3A5C' : fields[55] as String,
|
fields[55] == null ? '0xFF1A3A5C' : fields[55] as String,
|
||||||
useExampleData: fields[56] == null ? false : fields[56] as bool,
|
useExampleData: fields[56] == null ? false : fields[56] as bool,
|
||||||
partnerId: fields[57] as String?,
|
partnerId: fields[57] as String?,
|
||||||
|
sharePadSupplies: fields[58] == null ? true : fields[58] as bool,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void write(BinaryWriter writer, UserProfile obj) {
|
void write(BinaryWriter writer, UserProfile obj) {
|
||||||
writer
|
writer
|
||||||
..writeByte(57)
|
..writeByte(58)
|
||||||
..writeByte(0)
|
..writeByte(0)
|
||||||
..write(obj.id)
|
..write(obj.id)
|
||||||
..writeByte(1)
|
..writeByte(1)
|
||||||
@@ -244,7 +245,9 @@ class UserProfileAdapter extends TypeAdapter<UserProfile> {
|
|||||||
..writeByte(56)
|
..writeByte(56)
|
||||||
..write(obj.useExampleData)
|
..write(obj.useExampleData)
|
||||||
..writeByte(57)
|
..writeByte(57)
|
||||||
..write(obj.partnerId);
|
..write(obj.partnerId)
|
||||||
|
..writeByte(58)
|
||||||
|
..write(obj.sharePadSupplies);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
Reference in New Issue
Block a user