Your commit message here

This commit is contained in:
2025-12-19 22:47:27 -06:00
parent 5d746d694e
commit 464692ce56
21 changed files with 3018 additions and 0 deletions

View File

@@ -1,4 +1,9 @@
import 'package:hive/hive.dart';
<<<<<<< HEAD
=======
import 'package:flutter/material.dart';
import '../theme/app_theme.dart';
>>>>>>> 6742220 (Your commit message here)
part 'cycle_entry.g.dart';
@@ -111,6 +116,24 @@ class CycleEntry extends HiveObject {
@HiveField(11)
bool hasAcne;
<<<<<<< HEAD
=======
@HiveField(22)
bool hasLowerBackPain;
@HiveField(23)
bool hasConstipation;
@HiveField(24)
bool hasDiarrhea;
@HiveField(25)
int? stressLevel; // 1-5
@HiveField(26)
bool hasInsomnia;
>>>>>>> 6742220 (Your commit message here)
@HiveField(12)
double? basalBodyTemperature; // in Fahrenheit
@@ -154,6 +177,14 @@ class CycleEntry extends HiveObject {
this.hasBreastTenderness = false,
this.hasFatigue = false,
this.hasAcne = false,
<<<<<<< HEAD
=======
this.hasLowerBackPain = false,
this.hasConstipation = false,
this.hasDiarrhea = false,
this.stressLevel,
this.hasInsomnia = false,
>>>>>>> 6742220 (Your commit message here)
this.basalBodyTemperature,
this.cervicalMucus,
this.ovulationTestPositive,
@@ -173,7 +204,16 @@ class CycleEntry extends HiveObject {
hasBreastTenderness ||
hasFatigue ||
hasAcne ||
<<<<<<< HEAD
(crampIntensity != null && crampIntensity! > 0);
=======
hasLowerBackPain ||
hasConstipation ||
hasDiarrhea ||
hasInsomnia ||
(crampIntensity != null && crampIntensity! > 0) ||
(stressLevel != null && stressLevel! > 1);
>>>>>>> 6742220 (Your commit message here)
/// Check if NFP data is logged
bool get hasNFPData =>
@@ -189,7 +229,16 @@ class CycleEntry extends HiveObject {
if (hasBreastTenderness) count++;
if (hasFatigue) count++;
if (hasAcne) count++;
<<<<<<< HEAD
if (crampIntensity != null && crampIntensity! > 0) count++;
=======
if (hasLowerBackPain) count++;
if (hasConstipation) count++;
if (hasDiarrhea) count++;
if (hasInsomnia) count++;
if (crampIntensity != null && crampIntensity! > 0) count++;
if (stressLevel != null && stressLevel! > 1) count++;
>>>>>>> 6742220 (Your commit message here)
return count;
}
@@ -207,6 +256,14 @@ class CycleEntry extends HiveObject {
bool? hasBreastTenderness,
bool? hasFatigue,
bool? hasAcne,
<<<<<<< HEAD
=======
bool? hasLowerBackPain,
bool? hasConstipation,
bool? hasDiarrhea,
int? stressLevel,
bool? hasInsomnia,
>>>>>>> 6742220 (Your commit message here)
double? basalBodyTemperature,
CervicalMucusType? cervicalMucus,
bool? ovulationTestPositive,
@@ -231,6 +288,14 @@ class CycleEntry extends HiveObject {
hasBreastTenderness: hasBreastTenderness ?? this.hasBreastTenderness,
hasFatigue: hasFatigue ?? this.hasFatigue,
hasAcne: hasAcne ?? this.hasAcne,
<<<<<<< HEAD
=======
hasLowerBackPain: hasLowerBackPain ?? this.hasLowerBackPain,
hasConstipation: hasConstipation ?? this.hasConstipation,
hasDiarrhea: hasDiarrhea ?? this.hasDiarrhea,
stressLevel: stressLevel ?? this.stressLevel,
hasInsomnia: hasInsomnia ?? this.hasInsomnia,
>>>>>>> 6742220 (Your commit message here)
basalBodyTemperature: basalBodyTemperature ?? this.basalBodyTemperature,
cervicalMucus: cervicalMucus ?? this.cervicalMucus,
ovulationTestPositive: ovulationTestPositive ?? this.ovulationTestPositive,
@@ -319,6 +384,35 @@ extension CyclePhaseExtension on CyclePhase {
return '🌙';
}
}
<<<<<<< HEAD
=======
Color get color {
switch (this) {
case CyclePhase.menstrual:
return AppColors.menstrualPhase;
case CyclePhase.follicular:
return AppColors.follicularPhase;
case CyclePhase.ovulation:
return AppColors.ovulationPhase;
case CyclePhase.luteal:
return AppColors.lutealPhase;
}
}
List<Color> get gradientColors {
switch (this) {
case CyclePhase.menstrual:
return [AppColors.rose, AppColors.menstrualPhase, AppColors.blushPink];
case CyclePhase.follicular:
return [AppColors.sageGreen, AppColors.follicularPhase, AppColors.sageGreen.withOpacity(0.7)];
case CyclePhase.ovulation:
return [AppColors.lavender, AppColors.ovulationPhase, AppColors.rose];
case CyclePhase.luteal:
return [AppColors.lutealPhase, AppColors.lavender, AppColors.blushPink];
}
}
>>>>>>> 6742220 (Your commit message here)
String get description {
switch (this) {

View File

@@ -29,6 +29,14 @@ class CycleEntryAdapter extends TypeAdapter<CycleEntry> {
hasBreastTenderness: fields[9] as bool,
hasFatigue: fields[10] as bool,
hasAcne: fields[11] as bool,
<<<<<<< HEAD
=======
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,
>>>>>>> 6742220 (Your commit message here)
basalBodyTemperature: fields[12] as double?,
cervicalMucus: fields[13] as CervicalMucusType?,
ovulationTestPositive: fields[14] as bool?,
@@ -45,7 +53,11 @@ class CycleEntryAdapter extends TypeAdapter<CycleEntry> {
@override
void write(BinaryWriter writer, CycleEntry obj) {
writer
<<<<<<< HEAD
..writeByte(22)
=======
..writeByte(27)
>>>>>>> 6742220 (Your commit message here)
..writeByte(0)
..write(obj.id)
..writeByte(1)
@@ -70,6 +82,19 @@ class CycleEntryAdapter extends TypeAdapter<CycleEntry> {
..write(obj.hasFatigue)
..writeByte(11)
..write(obj.hasAcne)
<<<<<<< HEAD
=======
..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)
>>>>>>> 6742220 (Your commit message here)
..writeByte(12)
..write(obj.basalBodyTemperature)
..writeByte(13)

View File

@@ -1,18 +1,37 @@
<<<<<<< HEAD
/// Scripture model for daily verses and devotionals
class Scripture {
final String verse;
=======
import 'user_profile.dart';
/// Scripture model for daily verses and devotionals
class Scripture {
final Map<BibleTranslation, String> verses;
>>>>>>> 6742220 (Your commit message here)
final String reference;
final String? reflection;
final List<String> applicablePhases;
final List<String> applicableContexts;
const Scripture({
<<<<<<< HEAD
required this.verse,
=======
required this.verses,
>>>>>>> 6742220 (Your commit message here)
required this.reference,
this.reflection,
this.applicablePhases = const [],
this.applicableContexts = const [],
});
<<<<<<< HEAD
=======
String getVerse(BibleTranslation translation) {
return verses[translation] ?? verses[BibleTranslation.esv] ?? verses.values.first;
}
>>>>>>> 6742220 (Your commit message here)
}
/// Pre-defined scriptures for the app
@@ -20,17 +39,38 @@ class ScriptureDatabase {
/// Scriptures for menstrual phase (rest, comfort)
static const List<Scripture> menstrualScriptures = [
Scripture(
<<<<<<< HEAD
verse: "Come to me, all you who are weary and burdened, and I will give you rest.",
=======
verses: {
BibleTranslation.esv: "Come to me, all who labor and are heavy laden, and I will give you rest.",
BibleTranslation.niv: "Come to me, all you who are weary and burdened, and I will give you rest.",
BibleTranslation.nkjv: "Come to me, all you who labor and are heavy laden, and I will give you rest.",
BibleTranslation.nlt: "Come to me, all of you who are weary and carry heavy burdens, and I will give you rest.",
BibleTranslation.nasb: "Come to Me, all who are weary and burdened, and I will give you rest.",
BibleTranslation.kjv: "Come unto me, all ye that labour and are heavy laden, and I will give you rest.",
},
>>>>>>> 6742220 (Your commit message here)
reference: "Matthew 11:28",
reflection: "Your body is doing important work. Rest is not weakness—it's wisdom.",
applicablePhases: ['menstrual'],
),
Scripture(
<<<<<<< HEAD
verse: "He gives strength to the weary and increases the power of the weak.",
=======
verses: {
BibleTranslation.esv: "He gives power to the faint, and to him who has no might he increases strength.",
BibleTranslation.niv: "He gives strength to the weary and increases the power of the weak.",
BibleTranslation.nkjv: "He gives power to the weak, and to those who have no might He increases strength.",
BibleTranslation.nasb: "He gives strength to the weary, and to the one who lacks might He increases power.",
},
>>>>>>> 6742220 (Your commit message here)
reference: "Isaiah 40:29",
applicablePhases: ['menstrual'],
),
Scripture(
<<<<<<< HEAD
verse: "The Lord is my shepherd; I shall not want. He makes me lie down in green pastures.",
reference: "Psalm 23:1-2",
applicablePhases: ['menstrual'],
@@ -46,22 +86,50 @@ class ScriptureDatabase {
reference: "2 Corinthians 12:9",
applicablePhases: ['menstrual'],
),
=======
verses: {
BibleTranslation.esv: "The LORD is my shepherd; I shall not want. He makes me lie down in green pastures.",
BibleTranslation.niv: "The LORD is my shepherd, I lack nothing. He makes me lie down in green pastures.",
BibleTranslation.nkjv: "The LORD is my shepherd; I shall not want. He makes me to lie down in green pastures.",
},
reference: "Psalm 23:1-2",
applicablePhases: ['menstrual'],
),
>>>>>>> 6742220 (Your commit message here)
];
/// Scriptures for follicular phase (renewal, strength)
static const List<Scripture> follicularScriptures = [
Scripture(
<<<<<<< HEAD
verse: "She is clothed with strength and dignity; she can laugh at the days to come.",
=======
verses: {
BibleTranslation.esv: "Strength and dignity are her clothing, and she laughs at the time to come.",
BibleTranslation.niv: "She is clothed with strength and dignity; she can laugh at the days to come.",
BibleTranslation.nkjv: "Strength and honor are her clothing; she shall rejoice in time to come.",
BibleTranslation.nlt: "She is clothed with strength and dignity, and she laughs without fear of the future.",
},
>>>>>>> 6742220 (Your commit message here)
reference: "Proverbs 31:25",
reflection: "You're entering a season of renewed energy. Use it for His glory.",
applicablePhases: ['follicular'],
),
Scripture(
<<<<<<< HEAD
verse: "I can do all this through him who gives me strength.",
=======
verses: {
BibleTranslation.esv: "I can do all things through him who strengthens me.",
BibleTranslation.niv: "I can do all this through him who gives me strength.",
BibleTranslation.nkjv: "I can do all things through Christ who strengthens me.",
},
>>>>>>> 6742220 (Your commit message here)
reference: "Philippians 4:13",
applicablePhases: ['follicular'],
),
Scripture(
<<<<<<< HEAD
verse: "But those who hope in the Lord will renew their strength. They will soar on wings like eagles.",
reference: "Isaiah 40:31",
applicablePhases: ['follicular'],
@@ -76,17 +144,35 @@ class ScriptureDatabase {
reference: "Zephaniah 3:17",
applicablePhases: ['follicular'],
),
=======
verses: {
BibleTranslation.esv: "but they who wait for the LORD shall renew their strength; they shall mount up with wings like eagles.",
BibleTranslation.niv: "but those who hope in the LORD will renew their strength. They will soar on wings like eagles.",
},
reference: "Isaiah 40:31",
applicablePhases: ['follicular'],
),
>>>>>>> 6742220 (Your commit message here)
];
/// Scriptures for ovulation phase (creation, beauty)
static const List<Scripture> ovulationScriptures = [
Scripture(
<<<<<<< HEAD
verse: "For you created my inmost being; you knit me together in my mother's womb. I praise you because I am fearfully and wonderfully made.",
=======
verses: {
BibleTranslation.esv: "For you formed my inmost parts; you knitted me together in my mother's womb. I praise you, for I am fearfully and wonderfully made.",
BibleTranslation.niv: "For you created my inmost being; you knit me together in my mothers womb. I praise you because I am fearfully and wonderfully made.",
BibleTranslation.nkjv: "For You formed my inward parts; You covered me in my mothers womb. I will praise You, for I am fearfully and wonderfully made.",
},
>>>>>>> 6742220 (Your commit message here)
reference: "Psalm 139:13-14",
reflection: "Your body reflects the incredible creativity of God.",
applicablePhases: ['ovulation'],
),
Scripture(
<<<<<<< HEAD
verse: "Children are a heritage from the Lord, offspring a reward from him.",
reference: "Psalm 127:3",
applicablePhases: ['ovulation'],
@@ -101,22 +187,48 @@ class ScriptureDatabase {
reference: "James 1:17",
applicablePhases: ['ovulation'],
),
=======
verses: {
BibleTranslation.esv: "Behold, children are a heritage from the LORD, the fruit of the womb a reward.",
BibleTranslation.niv: "Children are a heritage from the LORD, offspring a reward from him.",
BibleTranslation.nkjv: "Behold, children are a heritage from the LORD, the fruit of the womb is a reward.",
},
reference: "Psalm 127:3",
applicablePhases: ['ovulation'],
),
>>>>>>> 6742220 (Your commit message here)
];
/// Scriptures for luteal phase / TWW (patience, trust)
static const List<Scripture> lutealScriptures = [
Scripture(
<<<<<<< HEAD
verse: "For I know the plans I have for you, declares the Lord, plans to prosper you and not to harm you, plans to give you hope and a future.",
=======
verses: {
BibleTranslation.esv: "For I know the plans I have for you, declares the LORD, plans for welfare and not for evil, to give you a future and a hope.",
BibleTranslation.niv: "For I know the plans I have for you,” declares the LORD, “plans to prosper you and not to harm you, plans to give you hope and a future.",
BibleTranslation.nkjv: "For I know the thoughts that I think toward you, says the LORD, thoughts of peace and not of evil, to give you a future and a hope.",
},
>>>>>>> 6742220 (Your commit message here)
reference: "Jeremiah 29:11",
reflection: "Whatever this season holds, God's plans for you are good.",
applicablePhases: ['luteal'],
),
Scripture(
<<<<<<< HEAD
verse: "Do not be anxious about anything, but in every situation, by prayer and petition, with thanksgiving, present your requests to God.",
=======
verses: {
BibleTranslation.esv: "do not be anxious about anything, but in everything by prayer and supplication with thanksgiving let your requests be made known to God.",
BibleTranslation.niv: "Do not be anxious about anything, but in every situation, by prayer and petition, with thanksgiving, present your requests to God.",
},
>>>>>>> 6742220 (Your commit message here)
reference: "Philippians 4:6",
applicablePhases: ['luteal'],
),
Scripture(
<<<<<<< HEAD
verse: "Trust in the Lord with all your heart and lean not on your own understanding.",
reference: "Proverbs 3:5",
applicablePhases: ['luteal'],
@@ -136,16 +248,33 @@ class ScriptureDatabase {
reference: "Psalm 27:14",
applicablePhases: ['luteal'],
),
=======
verses: {
BibleTranslation.esv: "Trust in the LORD with all your heart, and do not lean on your own understanding.",
BibleTranslation.niv: "Trust in the LORD with all your heart and lean not on your own understanding.",
},
reference: "Proverbs 3:5",
applicablePhases: ['luteal'],
),
>>>>>>> 6742220 (Your commit message here)
];
/// Scriptures for husbands
static const List<Scripture> husbandScriptures = [
Scripture(
<<<<<<< HEAD
verse: "Husbands, love your wives, just as Christ loved the church and gave himself up for her.",
=======
verses: {
BibleTranslation.esv: "Husbands, love your wives, as Christ loved the church and gave himself up for her.",
BibleTranslation.niv: "Husbands, love your wives, just as Christ loved the church and gave himself up for her.",
},
>>>>>>> 6742220 (Your commit message here)
reference: "Ephesians 5:25",
reflection: "Love sacrificially—putting her needs before your own.",
),
Scripture(
<<<<<<< HEAD
verse: "Husbands, in the same way be considerate as you live with your wives, and treat them with respect.",
reference: "1 Peter 3:7",
),
@@ -169,11 +298,20 @@ class ScriptureDatabase {
verse: "He who finds a wife finds what is good and receives favor from the Lord.",
reference: "Proverbs 18:22",
),
=======
verses: {
BibleTranslation.esv: "Likewise, husbands, live with your wives in an understanding way, showing honor to the woman.",
BibleTranslation.niv: "Husbands, in the same way be considerate as you live with your wives, and treat them with respect.",
},
reference: "1 Peter 3:7",
),
>>>>>>> 6742220 (Your commit message here)
];
/// General womanhood scriptures
static const List<Scripture> womanhoodScriptures = [
Scripture(
<<<<<<< HEAD
verse: "Charm is deceptive, and beauty is fleeting; but a woman who fears the Lord is to be praised.",
reference: "Proverbs 31:30",
),
@@ -191,6 +329,102 @@ class ScriptureDatabase {
),
];
=======
verses: {
BibleTranslation.esv: "Charm is deceitful, and beauty is vain, but a woman who fears the LORD is to be praised.",
BibleTranslation.niv: "Charm is deceptive, and beauty is fleeting; but a woman who fears the LORD is to be praised.",
},
reference: "Proverbs 31:30",
),
Scripture(
verses: {
BibleTranslation.esv: "She opens her mouth with wisdom, and the teaching of kindness is on her tongue.",
BibleTranslation.niv: "She opens her mouth with wisdom, and the teaching of kindness is on her tongue.",
},
reference: "Proverbs 31:26",
),
];
/// Scriptures for specific needs (contextual)
static const Map<String, List<Scripture>> contextualScriptures = {
'pain': [
Scripture(
verses: {
BibleTranslation.esv: "The LORD is near to the brokenhearted and saves the crushed in spirit.",
BibleTranslation.niv: "The LORD is close to the brokenhearted and saves those who are crushed in spirit.",
},
reference: "Psalm 34:18",
reflection: "He sees your pain and draws near to you in your discomfort.",
),
Scripture(
verses: {
BibleTranslation.esv: "Cast your burden on the LORD, and he will sustain you.",
BibleTranslation.niv: "Cast your cares on the LORD and he will sustain you.",
},
reference: "Psalm 55:22",
),
],
'fatigue': [
Scripture(
verses: {
BibleTranslation.esv: "He gives power to the faint, and to him who has no might he increases strength.",
BibleTranslation.niv: "He gives strength to the weary and increases the power of the weak.",
},
reference: "Isaiah 40:29",
),
Scripture(
verses: {
BibleTranslation.esv: "My grace is sufficient for you, for my power is made perfect in weakness.",
BibleTranslation.niv: "My grace is sufficient for you, for my power is made perfect in weakness.",
},
reference: "2 Corinthians 12:9",
),
],
'anxiety': [
Scripture(
verses: {
BibleTranslation.esv: "When the cares of my heart are many, your consolations cheer my soul.",
BibleTranslation.niv: "When anxiety was great within me, your consolation brought me joy.",
},
reference: "Psalm 94:19",
),
Scripture(
verses: {
BibleTranslation.esv: "Peace I leave with you; my peace I give to you. Not as the world gives do I give to you. Let not your hearts be troubled, neither let them be afraid.",
BibleTranslation.niv: "Peace I leave with you; my peace I give to you. I do not give to you as the world gives. Do not let your hearts be troubled and do not be afraid.",
},
reference: "John 14:27",
),
],
'joy': [
Scripture(
verses: {
BibleTranslation.esv: "The LORD is my strength and my shield; in him my heart trusts, and I am helped; my heart exults, and with my song I give thanks to him.",
BibleTranslation.niv: "The LORD is my strength and my shield; my heart trusts in him, and he helps me. My heart leaps for joy, and with my song I praise him.",
},
reference: "Psalm 28:7",
),
],
};
/// Get recommended scripture based on entry
static Scripture? getRecommendedScripture(CycleEntry entry) {
if (entry.mood == MoodLevel.verySad || entry.mood == MoodLevel.sad || (entry.stressLevel != null && entry.stressLevel! > 3)) {
return contextualScriptures['anxiety']![DateTime.now().day % contextualScriptures['anxiety']!.length];
}
if ((entry.crampIntensity != null && entry.crampIntensity! >= 3) || entry.hasHeadache || entry.hasLowerBackPain) {
return contextualScriptures['pain']![DateTime.now().day % contextualScriptures['pain']!.length];
}
if (entry.hasFatigue || entry.hasInsomnia || (entry.energyLevel != null && entry.energyLevel! <= 2)) {
return contextualScriptures['fatigue']![DateTime.now().day % contextualScriptures['fatigue']!.length];
}
if (entry.mood == MoodLevel.veryHappy) {
return contextualScriptures['joy']![DateTime.now().day % contextualScriptures['joy']!.length];
}
return null;
}
>>>>>>> 6742220 (Your commit message here)
/// Get scripture for current phase
static Scripture getScriptureForPhase(String phase) {
final List<Scripture> scriptures;

View File

@@ -28,6 +28,25 @@ enum FertilityGoal {
justTracking,
}
<<<<<<< HEAD
=======
@HiveType(typeId: 9)
enum BibleTranslation {
@HiveField(0)
esv,
@HiveField(1)
niv,
@HiveField(2)
nkjv,
@HiveField(3)
nlt,
@HiveField(4)
nasb,
@HiveField(5)
kjv,
}
>>>>>>> 6742220 (Your commit message here)
/// User profile model
@HiveType(typeId: 2)
class UserProfile extends HiveObject {
@@ -75,6 +94,12 @@ class UserProfile extends HiveObject {
@HiveField(15, defaultValue: false)
bool isIrregularCycle;
<<<<<<< HEAD
=======
@HiveField(16, defaultValue: BibleTranslation.esv)
BibleTranslation bibleTranslation;
>>>>>>> 6742220 (Your commit message here)
UserProfile({
required this.id,
@@ -90,9 +115,15 @@ class UserProfile extends HiveObject {
required this.createdAt,
required this.updatedAt,
this.partnerName,
<<<<<<< HEAD
this.role = UserRole.wife,
this.isIrregularCycle = false,
=======
this.role = UserRole.wife,
this.isIrregularCycle = false,
this.bibleTranslation = BibleTranslation.esv,
>>>>>>> 6742220 (Your commit message here)
});
/// Check if user is married
@@ -129,9 +160,15 @@ class UserProfile extends HiveObject {
DateTime? createdAt,
DateTime? updatedAt,
String? partnerName,
<<<<<<< HEAD
UserRole? role,
bool? isIrregularCycle,
=======
UserRole? role,
bool? isIrregularCycle,
BibleTranslation? bibleTranslation,
>>>>>>> 6742220 (Your commit message here)
}) {
return UserProfile(
id: id ?? this.id,
@@ -147,13 +184,35 @@ class UserProfile extends HiveObject {
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? DateTime.now(),
partnerName: partnerName ?? this.partnerName,
<<<<<<< HEAD
role: role ?? this.role,
isIrregularCycle: isIrregularCycle ?? this.isIrregularCycle,
=======
role: role ?? this.role,
isIrregularCycle: isIrregularCycle ?? this.isIrregularCycle,
bibleTranslation: bibleTranslation ?? this.bibleTranslation,
>>>>>>> 6742220 (Your commit message here)
);
}
}
<<<<<<< HEAD
=======
extension BibleTranslationExtension on BibleTranslation {
String get label {
switch (this) {
case BibleTranslation.esv: return 'ESV';
case BibleTranslation.niv: return 'NIV';
case BibleTranslation.nkjv: return 'NKJV';
case BibleTranslation.nlt: return 'NLT';
case BibleTranslation.nasb: return 'NASB';
case BibleTranslation.kjv: return 'KJV';
}
}
}
>>>>>>> 6742220 (Your commit message here)
@HiveType(typeId: 8)
enum UserRole {
@HiveField(0)

View File

@@ -32,13 +32,23 @@ class UserProfileAdapter extends TypeAdapter<UserProfile> {
partnerName: fields[12] as String?,
role: fields[14] == null ? UserRole.wife : fields[14] as UserRole,
isIrregularCycle: fields[15] == null ? false : fields[15] as bool,
<<<<<<< HEAD
=======
bibleTranslation: fields[16] == null
? BibleTranslation.esv
: fields[16] as BibleTranslation,
>>>>>>> 6742220 (Your commit message here)
);
}
@override
void write(BinaryWriter writer, UserProfile obj) {
writer
<<<<<<< HEAD
..writeByte(15)
=======
..writeByte(16)
>>>>>>> 6742220 (Your commit message here)
..writeByte(0)
..write(obj.id)
..writeByte(1)
@@ -68,7 +78,13 @@ class UserProfileAdapter extends TypeAdapter<UserProfile> {
..writeByte(14)
..write(obj.role)
..writeByte(15)
<<<<<<< HEAD
..write(obj.isIrregularCycle);
=======
..write(obj.isIrregularCycle)
..writeByte(16)
..write(obj.bibleTranslation);
>>>>>>> 6742220 (Your commit message here)
}
@override
@@ -170,6 +186,68 @@ class FertilityGoalAdapter extends TypeAdapter<FertilityGoal> {
typeId == other.typeId;
}
<<<<<<< HEAD
=======
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;
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;
}
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is BibleTranslationAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
>>>>>>> 6742220 (Your commit message here)
class UserRoleAdapter extends TypeAdapter<UserRole> {
@override
final int typeId = 8;