Skip to content

Commit cc601bf

Browse files
Fix merge issues
1 parent a84ae18 commit cc601bf

File tree

4 files changed

+10
-19
lines changed

4 files changed

+10
-19
lines changed

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/lib/database/repositories/periods_repository.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'dart:convert';
22

33
import 'package:menstrudel/models/flows/flow_enum.dart';
4-
import 'package:menstrudel/models/period_logs/symptom_enum.dart';
54
import 'package:sqflite/sqflite.dart';
65
import 'package:intl/intl.dart';
76
import 'package:flutter/material.dart';
@@ -329,11 +328,8 @@ class Manager {
329328
/// Validates a list of raw symptoms against the Symptom enum,
330329
/// filters out invalid entries, and then JSON encodes the resulting list of valid symptoms for database storage.
331330
String _encodeAndValidateSymptoms(List<dynamic> rawSymptoms) {
332-
final validSymptoms = Symptom.values.map((e) => e.name).toSet();
333-
334331
final List<String> filteredSymptoms = rawSymptoms
335332
.whereType<String>()
336-
.where((symptom) => validSymptoms.contains(symptom))
337333
.toList();
338334

339335
return jsonEncode(filteredSymptoms);

app/lib/services/settings_service.dart

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,6 @@ import 'package:menstrudel/models/themes/app_theme_mode_enum.dart';
66
enum PeriodHistoryView { list, journal }
77

88
class SettingsService {
9-
static const String _notificationsEnabledKey = 'notifications_enabled';
10-
static const String _notificationDaysKey = 'notification_days';
11-
static const _notificationTimeKey = 'notification_time';
12-
static const String _periodOverdueNotificationsEnabledKey = 'period_overdue_notifications_enabled';
13-
static const String _periodOverdueNotificationDaysKey = 'period_overdue_notification_days';
14-
static const _periodOverdueNotificationTimeKey = 'period_overdue_notification_time';
15-
static const _biometricEnabledKey = 'biometric_enabled';
16-
static const _historyViewKey = 'history_view';
17-
static const _dynamicColorKey = 'dynamic_color';
18-
static const _themeColorKey = 'theme_color';
19-
static const _themeModeKey = 'theme_mode';
20-
static const _persistentReminderKey = "always_show_reminder_button";
219

2210
Future<void> deleteAllSettings() async {
2311
final SharedPreferences prefs = await SharedPreferences.getInstance();
@@ -135,7 +123,7 @@ class SettingsService {
135123

136124
Future<PeriodHistoryView> getHistoryView() async {
137125
final prefs = await SharedPreferences.getInstance();
138-
final viewName = prefs.getString(_historyViewKey);
126+
final viewName = prefs.getString(historyViewKey);
139127
return PeriodHistoryView.values.firstWhere(
140128
(e) => e.name == viewName,
141129
orElse: () => PeriodHistoryView.journal,
@@ -174,7 +162,7 @@ class SettingsService {
174162

175163
Future<Set<String>> getDefaultSymptoms() async {
176164
final prefs = await SharedPreferences.getInstance();
177-
final storedDefaultSymptoms = prefs.getStringList(_defaultSymptomsKey);
165+
final storedDefaultSymptoms = prefs.getStringList(defaultSymptomsKey);
178166

179167
if (storedDefaultSymptoms == null || storedDefaultSymptoms.isEmpty) {
180168
return {"Headache", "Fatigue", "Cramps", "Nausea", "Mood Swings", "Bloating", "Acne", "Back pain"};
@@ -185,7 +173,7 @@ class SettingsService {
185173

186174
Future<void> setDefaultSymptoms(Set<String> symptoms) async {
187175
final prefs = await SharedPreferences.getInstance();
188-
prefs.setStringList(_defaultSymptomsKey, symptoms.toList());
176+
prefs.setStringList(defaultSymptomsKey, symptoms.toList());
189177
}
190178

191179
Future<void> addDefaultSymptom(String symptom) async {

app/lib/utils/constants.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const String dynamicColorKey = 'dynamic_color';
3737
const String themeColorKey = 'theme_color';
3838
const String themeModeKey = 'theme_mode';
3939
const String persistentReminderKey = "always_show_reminder_button";
40+
const String defaultSymptomsKey = "default_symptoms";
4041

4142
// Notifications
4243
const String tamponReminderDateTimeKey = 'tampon_reminder_date_time';

0 commit comments

Comments
 (0)