How to insert an item at an index in a List state? #1866
Replies: 1 comment 2 replies
-
state = [...state]..insert(index, value); |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
anmol-me
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
state => List list = [1, 2, 4];
Inside a state notifier, if I want to add an item to the list state, I would-
But now how do I add a new number '3' at the index of 2 and move the item at the index of 2 to the index of 3?
Beta Was this translation helpful? Give feedback.
All reactions