toggleFavorite method

Future<void> toggleFavorite(
  1. String id
)

Implementation

Future<void> toggleFavorite(String id) async {
  final result = await repository.toggleFavorite(id);

  result.fold(
    (error) => emit(state.copyWith(error: error)),
    (_) => _refresh(), // Reload respecting filter
  );
}