addItem method

void addItem(
  1. FireData<R> newItem
)

Implementation

void addItem(FireData<R> newItem) async {
  emit(
    state.copyWith(
      items: [newItem, ...state.items],

      ///So that all items added will be shown as new
      addedItems: [newItem],
      updatedAt: DateTime.now().millisecondsSinceEpoch,
    ),
  );
}