Refactor code structure for improved readability and maintainability
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -11,7 +11,15 @@ final mealPlanRepositoryProvider = Provider<MealPlanRepository>((ref) {
|
||||
return MealPlanRepository(ref.watch(apiClientProvider));
|
||||
});
|
||||
|
||||
final mealPlanWeekOffsetProvider = StateProvider<int>((ref) => 0);
|
||||
class _IntNotifier extends Notifier<int> {
|
||||
_IntNotifier(this._initial);
|
||||
final int _initial;
|
||||
@override
|
||||
int build() => _initial;
|
||||
}
|
||||
|
||||
final mealPlanWeekOffsetProvider =
|
||||
NotifierProvider<_IntNotifier, int>(() => _IntNotifier(0));
|
||||
|
||||
final mealPlanWeekProvider = Provider<MealPlanWeek>((ref) {
|
||||
final offset = ref.watch(mealPlanWeekOffsetProvider);
|
||||
|
||||
Reference in New Issue
Block a user