getFavorites method

Future<void> getFavorites()

Implementation

Future<void> getFavorites() async {
  emit(state.copyWith(isLoading: true));

  final result = await repository.getFavorites();

  result.fold(
    (error) => emit(state.copyWith(isLoading: false, error: error)),
    (components) => emit(state.copyWith(
      isLoading: false,
      filteredComponents: components,
    )),
  );
}