setItems method

Future<void> setItems(
  1. List<T> items
)

Implementation

Future<void> setItems(List<T> items) async {
  try {
    emit(state.copy(isLoading: true));
    await handler.inserts(data: items);
    emit(state.copy(result: items, isLoading: false));
  } catch (_) {
    emit(state.copy(error: "Something went wrong!"));
    rethrow;
  }
}