Commit 550f523

derdilla <82763757+NobodyForNothing@users.noreply.github.com>
2024-01-17 19:50:00
make Settings more clear on purpose
Signed-off-by: derdilla <82763757+NobodyForNothing@users.noreply.github.com>
1 parent 4af1e41
Changed files (1)
lib
model
lib/model/storage/settings_store.dart
@@ -9,8 +9,8 @@ import 'package:flutter/material.dart';
 /// Stores settings that are directly controllable by the user through the
 /// settings screen.
 ///
-/// This class should not be used to save persistent state that the user doesn't
-/// know about.
+/// This class should not be used to save persistent state of individual app
+/// components and screens.
 ///
 /// The `storage.dart` library comment has more information on the architecture
 /// for adding persistent fields.
@@ -362,6 +362,8 @@ class Settings extends ChangeNotifier {
   /// intakes will be displayed with a deleted medicine text.
   void removeMedicationAt(int index) {
     assert(index >= 0 && index < _medications.length);
+    assert(!_medications[index].hidden, 'Removing a already hidden medication '
+        'indicates a bug.');
     _medications[index].hidden = true;
     notifyListeners();
   }