shiftAdd<T> function
List<Tuple2<T?, Store<SwipeFeedCardState> > >
shiftAdd<T>(
- List<
Tuple2< oldItems,T?, Store< >SwipeFeedCardState> > - List<
Tuple2< newItemsT, Store< >SwipeFeedCardState> >
Implementation
List<Tuple2<T?, Store<SwipeFeedCardState>>> shiftAdd<T>(List<Tuple2<T?, Store<SwipeFeedCardState>>> oldItems, List<Tuple2<T, Store<SwipeFeedCardState>>> newItems){
int index = oldItems.indexWhere((element) => element.item1 == null);
if(index == -1){
return [Tuple2(null, SwipeFeedCardState.tower())];
}
else{
oldItems.insertAll(index, newItems);
}
return oldItems;
}