my plans and my diets

This commit is contained in:
Username1548
2024-12-23 15:36:00 +07:00
parent 15a6ff44ef
commit 5ef1f3a660
52 changed files with 3857 additions and 573 deletions

View File

@@ -9,7 +9,7 @@ import 'package:eatvio_app/features/feed/presentation/bloc/diets_cubit/diets_sta
import 'package:eatvio_app/features/feed/repositories/feed_repository.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class DietsCubit extends Cubit<DietsState> {
class DietsCubit extends Cubit<DietsState>{
final FeedRepository feedRepository;
final DietRepository dietsRepository;
int currentPage = 1;
@@ -52,6 +52,7 @@ class DietsCubit extends Cubit<DietsState> {
super.close();
}
void changeTypeFilter(int index) {
emit(state.copyWith(filterState: state.filterState.copyWith(typeIndex: index), errorMessage: null));
EasyDebounce.debounce(
@@ -63,6 +64,7 @@ class DietsCubit extends Cubit<DietsState> {
);
}
void changeSortingType(int index) {
emit(state.copyWith(filterState: state.filterState.copyWith(sortingIndex: index), errorMessage: null));
EasyDebounce.debounce(
@@ -74,6 +76,7 @@ class DietsCubit extends Cubit<DietsState> {
);
}
void changeDurationFilter(int index) {
emit(state.copyWith(filterState: state.filterState.copyWith(durationIndex: index), errorMessage: null));
EasyDebounce.debounce(
@@ -101,7 +104,11 @@ class DietsCubit extends Cubit<DietsState> {
);
lastPage = dietsPagination.meta.lastPage;
emit(
state.copyWith(dietsList: dietsPagination.data, isLoading: isLoading, errorMessage: null,),
state.copyWith(
dietsList: dietsPagination.data,
isLoading: isLoading,
errorMessage: null,
),
);
} catch (e) {
emit(