Files
Tracker/lib/models/user_profile.g.dart
Sterlen 1c2c56e9e2 feat: Add auto-sync, fix partner linking UI, update sharing settings
- Add 10-second periodic auto-sync to CycleEntriesNotifier
- Fix husband_devotional_screen: use partnerId for isConnected check, navigate to SharingSettingsScreen instead of legacy mock dialog
- Remove obsolete _showConnectDialog method and mock data import
- Update husband_settings_screen: show 'Partner Settings' with linked partner name when connected
- Add SharingSettingsScreen: Pad Supplies toggle (disabled when pad tracking off), Intimacy always enabled
- Add CORS OPTIONS handler to backend server
- Add _ensureServerRegistration for reliable partner linking
- Add copy button to Invite Partner dialog
- Dynamic base URL for web (uses window.location.hostname)
2026-01-09 17:20:49 -06:00

569 lines
16 KiB
Dart

// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'user_profile.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class SupplyItemAdapter extends TypeAdapter<SupplyItem> {
@override
final int typeId = 12;
@override
SupplyItem read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return SupplyItem(
brand: fields[0] as String,
type: fields[1] as PadType,
absorbency: fields[2] as int,
count: fields[3] as int,
);
}
@override
void write(BinaryWriter writer, SupplyItem obj) {
writer
..writeByte(4)
..writeByte(0)
..write(obj.brand)
..writeByte(1)
..write(obj.type)
..writeByte(2)
..write(obj.absorbency)
..writeByte(3)
..write(obj.count);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is SupplyItemAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
class UserProfileAdapter extends TypeAdapter<UserProfile> {
@override
final int typeId = 2;
@override
UserProfile read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return UserProfile(
id: fields[0] as String,
name: fields[1] as String,
relationshipStatus: fields[2] == null
? RelationshipStatus.single
: fields[2] as RelationshipStatus,
fertilityGoal: fields[3] as FertilityGoal?,
averageCycleLength: fields[4] == null ? 28 : fields[4] as int,
averagePeriodLength: fields[5] == null ? 5 : fields[5] as int,
lastPeriodStartDate: fields[6] as DateTime?,
notificationsEnabled: fields[8] == null ? true : fields[8] as bool,
hasCompletedOnboarding: fields[9] == null ? false : fields[9] as bool,
createdAt: fields[10] as DateTime,
updatedAt: fields[11] as DateTime,
partnerName: fields[12] as String?,
role: fields[14] == null ? UserRole.wife : fields[14] as UserRole,
isIrregularCycle: fields[15] == null ? false : fields[15] as bool,
minCycleLength: fields[41] == null ? 21 : fields[41] as int,
maxCycleLength: fields[42] == null ? 40 : fields[42] as int,
bibleTranslation: fields[16] == null
? BibleTranslation.esv
: fields[16] as BibleTranslation,
favoriteFoods: (fields[17] as List?)?.cast<String>(),
isDataShared: fields[18] == null ? false : fields[18] as bool,
themeMode:
fields[19] == null ? AppThemeMode.system : fields[19] as AppThemeMode,
accentColor: fields[20] == null ? '0xFFA8C5A8' : fields[20] as String,
shareMoods: fields[21] == null ? true : fields[21] as bool,
shareSymptoms: fields[22] == null ? true : fields[22] as bool,
shareCravings: fields[23] == null ? true : fields[23] as bool,
shareEnergyLevels: fields[24] == null ? true : fields[24] as bool,
shareSleep: fields[25] == null ? true : fields[25] as bool,
shareIntimacy: fields[26] == null ? true : fields[26] as bool,
isPadTrackingEnabled: fields[27] == null ? false : fields[27] as bool,
typicalFlowIntensity: fields[28] as int?,
padBrand: fields[29] as String?,
padAbsorbency: fields[30] as int?,
padInventoryCount: fields[31] == null ? 0 : fields[31] as int,
lowInventoryThreshold: fields[32] == null ? 5 : fields[32] as int,
isAutoInventoryEnabled: fields[33] == null ? true : fields[33] as bool,
lastInventoryUpdate: fields[34] as DateTime?,
notifyPeriodEstimate: fields[35] == null ? true : fields[35] as bool,
notifyPeriodStart: fields[36] == null ? true : fields[36] as bool,
notifyLowSupply: fields[37] == null ? true : fields[37] as bool,
lastPadChangeTime: fields[7] as DateTime?,
padSupplies: (fields[38] as List?)?.cast<SupplyItem>(),
showPadTimerMinutes: fields[39] == null ? true : fields[39] as bool,
showPadTimerSeconds: fields[40] == null ? false : fields[40] as bool,
notifyPad1Hour: fields[43] == null ? false : fields[43] as bool,
notifyPad2Hours: fields[44] == null ? false : fields[44] as bool,
privacyPin: fields[45] as String?,
isBioProtected: fields[46] == null ? false : fields[46] as bool,
isHistoryProtected: fields[47] == null ? false : fields[47] as bool,
notifyPad30Mins: fields[48] == null ? false : fields[48] as bool,
notifyPadNow: fields[49] == null ? true : fields[49] as bool,
isLogProtected: fields[50] == null ? false : fields[50] as bool,
isCalendarProtected: fields[51] == null ? false : fields[51] as bool,
isSuppliesProtected: fields[52] == null ? false : fields[52] as bool,
teachingPlans: (fields[53] as List?)?.cast<TeachingPlan>(),
husbandThemeMode:
fields[54] == null ? AppThemeMode.system : fields[54] as AppThemeMode,
husbandAccentColor:
fields[55] == null ? '0xFF1A3A5C' : fields[55] as String,
useExampleData: fields[56] == null ? false : fields[56] as bool,
partnerId: fields[57] as String?,
);
}
@override
void write(BinaryWriter writer, UserProfile obj) {
writer
..writeByte(57)
..writeByte(0)
..write(obj.id)
..writeByte(1)
..write(obj.name)
..writeByte(2)
..write(obj.relationshipStatus)
..writeByte(3)
..write(obj.fertilityGoal)
..writeByte(4)
..write(obj.averageCycleLength)
..writeByte(5)
..write(obj.averagePeriodLength)
..writeByte(6)
..write(obj.lastPeriodStartDate)
..writeByte(7)
..write(obj.lastPadChangeTime)
..writeByte(8)
..write(obj.notificationsEnabled)
..writeByte(9)
..write(obj.hasCompletedOnboarding)
..writeByte(10)
..write(obj.createdAt)
..writeByte(11)
..write(obj.updatedAt)
..writeByte(12)
..write(obj.partnerName)
..writeByte(14)
..write(obj.role)
..writeByte(15)
..write(obj.isIrregularCycle)
..writeByte(41)
..write(obj.minCycleLength)
..writeByte(42)
..write(obj.maxCycleLength)
..writeByte(16)
..write(obj.bibleTranslation)
..writeByte(17)
..write(obj.favoriteFoods)
..writeByte(18)
..write(obj.isDataShared)
..writeByte(19)
..write(obj.themeMode)
..writeByte(20)
..write(obj.accentColor)
..writeByte(21)
..write(obj.shareMoods)
..writeByte(22)
..write(obj.shareSymptoms)
..writeByte(23)
..write(obj.shareCravings)
..writeByte(24)
..write(obj.shareEnergyLevels)
..writeByte(25)
..write(obj.shareSleep)
..writeByte(26)
..write(obj.shareIntimacy)
..writeByte(27)
..write(obj.isPadTrackingEnabled)
..writeByte(28)
..write(obj.typicalFlowIntensity)
..writeByte(29)
..write(obj.padBrand)
..writeByte(30)
..write(obj.padAbsorbency)
..writeByte(31)
..write(obj.padInventoryCount)
..writeByte(32)
..write(obj.lowInventoryThreshold)
..writeByte(33)
..write(obj.isAutoInventoryEnabled)
..writeByte(34)
..write(obj.lastInventoryUpdate)
..writeByte(38)
..write(obj.padSupplies)
..writeByte(35)
..write(obj.notifyPeriodEstimate)
..writeByte(36)
..write(obj.notifyPeriodStart)
..writeByte(37)
..write(obj.notifyLowSupply)
..writeByte(39)
..write(obj.showPadTimerMinutes)
..writeByte(40)
..write(obj.showPadTimerSeconds)
..writeByte(43)
..write(obj.notifyPad1Hour)
..writeByte(44)
..write(obj.notifyPad2Hours)
..writeByte(45)
..write(obj.privacyPin)
..writeByte(46)
..write(obj.isBioProtected)
..writeByte(47)
..write(obj.isHistoryProtected)
..writeByte(48)
..write(obj.notifyPad30Mins)
..writeByte(49)
..write(obj.notifyPadNow)
..writeByte(50)
..write(obj.isLogProtected)
..writeByte(51)
..write(obj.isCalendarProtected)
..writeByte(52)
..write(obj.isSuppliesProtected)
..writeByte(53)
..write(obj.teachingPlans)
..writeByte(54)
..write(obj.husbandThemeMode)
..writeByte(55)
..write(obj.husbandAccentColor)
..writeByte(56)
..write(obj.useExampleData)
..writeByte(57)
..write(obj.partnerId);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is UserProfileAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
class RelationshipStatusAdapter extends TypeAdapter<RelationshipStatus> {
@override
final int typeId = 0;
@override
RelationshipStatus read(BinaryReader reader) {
switch (reader.readByte()) {
case 0:
return RelationshipStatus.single;
case 1:
return RelationshipStatus.engaged;
case 2:
return RelationshipStatus.married;
default:
return RelationshipStatus.single;
}
}
@override
void write(BinaryWriter writer, RelationshipStatus obj) {
switch (obj) {
case RelationshipStatus.single:
writer.writeByte(0);
break;
case RelationshipStatus.engaged:
writer.writeByte(1);
break;
case RelationshipStatus.married:
writer.writeByte(2);
break;
}
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is RelationshipStatusAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
class FertilityGoalAdapter extends TypeAdapter<FertilityGoal> {
@override
final int typeId = 1;
@override
FertilityGoal read(BinaryReader reader) {
switch (reader.readByte()) {
case 0:
return FertilityGoal.tryingToConceive;
case 1:
return FertilityGoal.tryingToAvoid;
case 2:
return FertilityGoal.justTracking;
default:
return FertilityGoal.tryingToConceive;
}
}
@override
void write(BinaryWriter writer, FertilityGoal obj) {
switch (obj) {
case FertilityGoal.tryingToConceive:
writer.writeByte(0);
break;
case FertilityGoal.tryingToAvoid:
writer.writeByte(1);
break;
case FertilityGoal.justTracking:
writer.writeByte(2);
break;
}
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is FertilityGoalAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
class BibleTranslationAdapter extends TypeAdapter<BibleTranslation> {
@override
final int typeId = 9;
@override
BibleTranslation read(BinaryReader reader) {
switch (reader.readByte()) {
case 0:
return BibleTranslation.esv;
case 1:
return BibleTranslation.niv;
case 2:
return BibleTranslation.nkjv;
case 3:
return BibleTranslation.nlt;
case 4:
return BibleTranslation.nasb;
case 5:
return BibleTranslation.kjv;
case 6:
return BibleTranslation.msg;
default:
return BibleTranslation.esv;
}
}
@override
void write(BinaryWriter writer, BibleTranslation obj) {
switch (obj) {
case BibleTranslation.esv:
writer.writeByte(0);
break;
case BibleTranslation.niv:
writer.writeByte(1);
break;
case BibleTranslation.nkjv:
writer.writeByte(2);
break;
case BibleTranslation.nlt:
writer.writeByte(3);
break;
case BibleTranslation.nasb:
writer.writeByte(4);
break;
case BibleTranslation.kjv:
writer.writeByte(5);
break;
case BibleTranslation.msg:
writer.writeByte(6);
break;
}
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is BibleTranslationAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
class AppThemeModeAdapter extends TypeAdapter<AppThemeMode> {
@override
final int typeId = 11;
@override
AppThemeMode read(BinaryReader reader) {
switch (reader.readByte()) {
case 0:
return AppThemeMode.system;
case 1:
return AppThemeMode.light;
case 2:
return AppThemeMode.dark;
default:
return AppThemeMode.system;
}
}
@override
void write(BinaryWriter writer, AppThemeMode obj) {
switch (obj) {
case AppThemeMode.system:
writer.writeByte(0);
break;
case AppThemeMode.light:
writer.writeByte(1);
break;
case AppThemeMode.dark:
writer.writeByte(2);
break;
}
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is AppThemeModeAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
class PadTypeAdapter extends TypeAdapter<PadType> {
@override
final int typeId = 13;
@override
PadType read(BinaryReader reader) {
switch (reader.readByte()) {
case 0:
return PadType.pantyLiner;
case 1:
return PadType.regular;
case 2:
return PadType.superPad;
case 3:
return PadType.overnight;
case 4:
return PadType.tamponRegular;
case 5:
return PadType.tamponSuper;
case 6:
return PadType.menstrualCup;
case 7:
return PadType.menstrualDisc;
case 8:
return PadType.periodUnderwear;
default:
return PadType.pantyLiner;
}
}
@override
void write(BinaryWriter writer, PadType obj) {
switch (obj) {
case PadType.pantyLiner:
writer.writeByte(0);
break;
case PadType.regular:
writer.writeByte(1);
break;
case PadType.superPad:
writer.writeByte(2);
break;
case PadType.overnight:
writer.writeByte(3);
break;
case PadType.tamponRegular:
writer.writeByte(4);
break;
case PadType.tamponSuper:
writer.writeByte(5);
break;
case PadType.menstrualCup:
writer.writeByte(6);
break;
case PadType.menstrualDisc:
writer.writeByte(7);
break;
case PadType.periodUnderwear:
writer.writeByte(8);
break;
}
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is PadTypeAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
class UserRoleAdapter extends TypeAdapter<UserRole> {
@override
final int typeId = 8;
@override
UserRole read(BinaryReader reader) {
switch (reader.readByte()) {
case 0:
return UserRole.wife;
case 1:
return UserRole.husband;
default:
return UserRole.wife;
}
}
@override
void write(BinaryWriter writer, UserRole obj) {
switch (obj) {
case UserRole.wife:
writer.writeByte(0);
break;
case UserRole.husband:
writer.writeByte(1);
break;
}
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is UserRoleAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}