feat: rename DailyStatusRepository to DailyStatusModel and wrap with a ChangeNotifierProvider
This commit is contained in:
parent
88b50708c2
commit
77418d216f
2 changed files with 14 additions and 10 deletions
|
|
@ -1,9 +1,10 @@
|
|||
import 'models/daily_entry_model.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class DailyStatusRepository {
|
||||
class DailyStatusModel extends ChangeNotifier {
|
||||
DailyEntry? currentDay;
|
||||
|
||||
DailyStatusRepository();
|
||||
DailyStatusModel();
|
||||
|
||||
void logFeelingMigrainy(bool status) {
|
||||
if (currentDay == null) {
|
||||
|
|
@ -22,6 +23,7 @@ class DailyStatusRepository {
|
|||
tookPainMeds: currentDay!.tookPainMeds
|
||||
);
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void logTookZomig(bool status) {
|
||||
|
|
@ -41,6 +43,7 @@ class DailyStatusRepository {
|
|||
tookPainMeds: currentDay!.tookPainMeds
|
||||
);
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
DateTime getCurrentDate() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue