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.
286 lines
7.2 KiB
Dart
286 lines
7.2 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'user_profile.dart';
|
|
|
|
// **************************************************************************
|
|
// TypeAdapterGenerator
|
|
// **************************************************************************
|
|
|
|
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] as RelationshipStatus,
|
|
fertilityGoal: fields[3] as FertilityGoal?,
|
|
averageCycleLength: fields[4] as int,
|
|
averagePeriodLength: fields[5] as int,
|
|
lastPeriodStartDate: fields[6] as DateTime?,
|
|
notificationsEnabled: fields[7] as bool,
|
|
devotionalTime: fields[8] as String?,
|
|
hasCompletedOnboarding: 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,
|
|
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,
|
|
);
|
|
}
|
|
|
|
@override
|
|
void write(BinaryWriter writer, UserProfile obj) {
|
|
writer
|
|
..writeByte(18)
|
|
..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.notificationsEnabled)
|
|
..writeByte(8)
|
|
..write(obj.devotionalTime)
|
|
..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(16)
|
|
..write(obj.bibleTranslation)
|
|
..writeByte(17)
|
|
..write(obj.favoriteFoods)
|
|
..writeByte(18)
|
|
..write(obj.isDataShared);
|
|
}
|
|
|
|
@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 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;
|
|
}
|