deleteComponent method

Future<void> deleteComponent(
  1. String id
)

Implementation

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

  final result = await repository.delete(id);

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