forked from eatvio/eatvio_app
socket fixed
This commit is contained in:
@@ -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,7 +52,6 @@ class DietsCubit extends Cubit<DietsState>{
|
||||
super.close();
|
||||
}
|
||||
|
||||
|
||||
void changeTypeFilter(int index) {
|
||||
emit(state.copyWith(filterState: state.filterState.copyWith(typeIndex: index), errorMessage: null));
|
||||
EasyDebounce.debounce(
|
||||
@@ -64,7 +63,6 @@ class DietsCubit extends Cubit<DietsState>{
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void changeSortingType(int index) {
|
||||
emit(state.copyWith(filterState: state.filterState.copyWith(sortingIndex: index), errorMessage: null));
|
||||
EasyDebounce.debounce(
|
||||
@@ -76,7 +74,6 @@ class DietsCubit extends Cubit<DietsState>{
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void changeDurationFilter(int index) {
|
||||
emit(state.copyWith(filterState: state.filterState.copyWith(durationIndex: index), errorMessage: null));
|
||||
EasyDebounce.debounce(
|
||||
@@ -153,6 +150,7 @@ class DietsCubit extends Cubit<DietsState>{
|
||||
|
||||
Future<void> likeDiet(int id, int index) async {
|
||||
final currentDiets = state.dietsList;
|
||||
if (currentDiets.isEmpty) return;
|
||||
final dietsForModification = [...currentDiets];
|
||||
final currentDiet = currentDiets[index];
|
||||
if (currentDiet.wasLikedByMe) {
|
||||
|
||||
Reference in New Issue
Block a user