Files
Tracker/lib/models/cycle_entry.g.dart
Sterlen b4b2bfe749 feat: Implement husband features and fix iOS Safari web startup
Implement initial features for husband's companion app, including mock data
service and husband notes screen. Refactor scripture and cycle services
for improved stability and testability. Address iOS Safari web app
startup issue by removing deprecated initialization.

- Implemented MockDataService and HusbandNotesScreen.
- Converted _DashboardTab and DevotionalScreen to StatefulWidgets for robust
  scripture provider initialization.
- Refactored CycleService to use immutable CycleInfo class, reducing UI rebuilds.
- Removed deprecated window.flutterConfiguration from index.html, resolving
  Flutter web app startup failure on iOS Safari.
- Updated and fixed related tests.
2025-12-26 22:40:52 -06:00

335 lines
8.3 KiB
Dart

// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'cycle_entry.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class CycleEntryAdapter extends TypeAdapter<CycleEntry> {
@override
final int typeId = 7;
@override
CycleEntry read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return CycleEntry(
id: fields[0] as String,
date: fields[1] as DateTime,
isPeriodDay: fields[2] as bool,
flowIntensity: fields[3] as FlowIntensity?,
mood: fields[4] as MoodLevel?,
energyLevel: fields[5] as int?,
crampIntensity: fields[6] as int?,
hasHeadache: fields[7] as bool,
hasBloating: fields[8] as bool,
hasBreastTenderness: fields[9] as bool,
hasFatigue: fields[10] as bool,
hasAcne: fields[11] as bool,
hasLowerBackPain: fields[22] as bool,
hasConstipation: fields[23] as bool,
hasDiarrhea: fields[24] as bool,
stressLevel: fields[25] as int?,
hasInsomnia: fields[26] as bool,
basalBodyTemperature: fields[12] as double?,
cervicalMucus: fields[13] as CervicalMucusType?,
ovulationTestPositive: fields[14] as bool?,
notes: fields[15] as String?,
cravings: (fields[27] as List?)?.cast<String>(),
sleepHours: fields[16] as int?,
waterIntake: fields[17] as int?,
hadExercise: fields[18] as bool,
hadIntimacy: fields[19] as bool,
intimacyProtected: fields[29] as bool?,
createdAt: fields[20] as DateTime,
updatedAt: fields[21] as DateTime,
husbandNotes: fields[28] as String?,
);
}
@override
void write(BinaryWriter writer, CycleEntry obj) {
writer
..writeByte(30)
..writeByte(0)
..write(obj.id)
..writeByte(1)
..write(obj.date)
..writeByte(2)
..write(obj.isPeriodDay)
..writeByte(3)
..write(obj.flowIntensity)
..writeByte(4)
..write(obj.mood)
..writeByte(5)
..write(obj.energyLevel)
..writeByte(6)
..write(obj.crampIntensity)
..writeByte(7)
..write(obj.hasHeadache)
..writeByte(8)
..write(obj.hasBloating)
..writeByte(9)
..write(obj.hasBreastTenderness)
..writeByte(10)
..write(obj.hasFatigue)
..writeByte(11)
..write(obj.hasAcne)
..writeByte(22)
..write(obj.hasLowerBackPain)
..writeByte(23)
..write(obj.hasConstipation)
..writeByte(24)
..write(obj.hasDiarrhea)
..writeByte(25)
..write(obj.stressLevel)
..writeByte(26)
..write(obj.hasInsomnia)
..writeByte(12)
..write(obj.basalBodyTemperature)
..writeByte(13)
..write(obj.cervicalMucus)
..writeByte(14)
..write(obj.ovulationTestPositive)
..writeByte(15)
..write(obj.notes)
..writeByte(16)
..write(obj.sleepHours)
..writeByte(17)
..write(obj.waterIntake)
..writeByte(18)
..write(obj.hadExercise)
..writeByte(19)
..write(obj.hadIntimacy)
..writeByte(20)
..write(obj.createdAt)
..writeByte(21)
..write(obj.updatedAt)
..writeByte(27)
..write(obj.cravings)
..writeByte(28)
..write(obj.husbandNotes)
..writeByte(29)
..write(obj.intimacyProtected);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is CycleEntryAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
class MoodLevelAdapter extends TypeAdapter<MoodLevel> {
@override
final int typeId = 3;
@override
MoodLevel read(BinaryReader reader) {
switch (reader.readByte()) {
case 0:
return MoodLevel.verySad;
case 1:
return MoodLevel.sad;
case 2:
return MoodLevel.neutral;
case 3:
return MoodLevel.happy;
case 4:
return MoodLevel.veryHappy;
default:
return MoodLevel.verySad;
}
}
@override
void write(BinaryWriter writer, MoodLevel obj) {
switch (obj) {
case MoodLevel.verySad:
writer.writeByte(0);
break;
case MoodLevel.sad:
writer.writeByte(1);
break;
case MoodLevel.neutral:
writer.writeByte(2);
break;
case MoodLevel.happy:
writer.writeByte(3);
break;
case MoodLevel.veryHappy:
writer.writeByte(4);
break;
}
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is MoodLevelAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
class FlowIntensityAdapter extends TypeAdapter<FlowIntensity> {
@override
final int typeId = 4;
@override
FlowIntensity read(BinaryReader reader) {
switch (reader.readByte()) {
case 0:
return FlowIntensity.spotting;
case 1:
return FlowIntensity.light;
case 2:
return FlowIntensity.medium;
case 3:
return FlowIntensity.heavy;
default:
return FlowIntensity.spotting;
}
}
@override
void write(BinaryWriter writer, FlowIntensity obj) {
switch (obj) {
case FlowIntensity.spotting:
writer.writeByte(0);
break;
case FlowIntensity.light:
writer.writeByte(1);
break;
case FlowIntensity.medium:
writer.writeByte(2);
break;
case FlowIntensity.heavy:
writer.writeByte(3);
break;
}
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is FlowIntensityAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
class CervicalMucusTypeAdapter extends TypeAdapter<CervicalMucusType> {
@override
final int typeId = 5;
@override
CervicalMucusType read(BinaryReader reader) {
switch (reader.readByte()) {
case 0:
return CervicalMucusType.dry;
case 1:
return CervicalMucusType.sticky;
case 2:
return CervicalMucusType.creamy;
case 3:
return CervicalMucusType.eggWhite;
case 4:
return CervicalMucusType.watery;
default:
return CervicalMucusType.dry;
}
}
@override
void write(BinaryWriter writer, CervicalMucusType obj) {
switch (obj) {
case CervicalMucusType.dry:
writer.writeByte(0);
break;
case CervicalMucusType.sticky:
writer.writeByte(1);
break;
case CervicalMucusType.creamy:
writer.writeByte(2);
break;
case CervicalMucusType.eggWhite:
writer.writeByte(3);
break;
case CervicalMucusType.watery:
writer.writeByte(4);
break;
}
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is CervicalMucusTypeAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
class CyclePhaseAdapter extends TypeAdapter<CyclePhase> {
@override
final int typeId = 6;
@override
CyclePhase read(BinaryReader reader) {
switch (reader.readByte()) {
case 0:
return CyclePhase.menstrual;
case 1:
return CyclePhase.follicular;
case 2:
return CyclePhase.ovulation;
case 3:
return CyclePhase.luteal;
default:
return CyclePhase.menstrual;
}
}
@override
void write(BinaryWriter writer, CyclePhase obj) {
switch (obj) {
case CyclePhase.menstrual:
writer.writeByte(0);
break;
case CyclePhase.follicular:
writer.writeByte(1);
break;
case CyclePhase.ovulation:
writer.writeByte(2);
break;
case CyclePhase.luteal:
writer.writeByte(3);
break;
}
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is CyclePhaseAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}