diff --git a/lib/providers/body_weight_state.dart b/lib/providers/body_weight_state.dart deleted file mode 100644 index 79c897e07..000000000 --- a/lib/providers/body_weight_state.dart +++ /dev/null @@ -1,38 +0,0 @@ -import 'package:logging/logging.dart'; -import 'package:state_notifier/state_notifier.dart'; -import 'package:wger/models/body_weight/weight_entry.dart'; - -/* - * TODO: decide if we want to use the state or just handle a list of entries - */ -class BodyWeightState extends StateNotifier> { - final _logger = Logger('BodyWeightState'); - - BodyWeightState([super.initial = const []]); - - List get items => [...state]; - - WeightEntry? getNewestEntry() => state.isNotEmpty ? state.first : null; - - WeightEntry? findById(String id) { - try { - return state.firstWhere((e) => e.id == id); - } on StateError { - return null; - } - } - - WeightEntry? findByDate(DateTime date) { - try { - return state.firstWhere((e) => e.date == date); - } on StateError { - return null; - } - } - - void clear() => state = []; - - void setItems(List entries) { - state = List.from(entries); - } -}