temp.removeAt(index); is exactly what you want.
void main() {
List<String> temp = ['a', 'b', 'c', 'd'];
temp.removeAt(2);
print(temp);
}
this function prints ['a', 'b', 'd'] which is what you wanted to get right?
but if you can also get the removed value with this.
void main() {
List<String> temp = ['a', 'b', 'c', 'd'];
var removedValue = temp.removeAt(2);
print(removedValue);
}
If what you want is to get a clone of the original list but without the element you can create a new one like this.
void main() {
List<String> temp = ['a', 'b', 'c', 'd'];
int indexToRemove = 2;
List newList = temp.where((x) => temp.indexOf(x) != indexToRemove).toList();
print(newList);
}