Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you change the value of a List[index].fieldname flutter?

Tags:

flutter

dart

How do you change the value of a List[index].fieldname flutter?

like image 857
Chinna Bhabu Avatar asked Sep 18 '18 18:09

Chinna Bhabu


People also ask

How do you change the index of a list in flutter?

You can use insert , but I solved by reversing the listView. @YeasinSheikh reversing the list only make it upside down.. I just want to push an item to index first and reduce others indexes by -1.


1 Answers

class Person {
  String firstName;
  String lastName;
}

//assuming contacts is a List<Person>

contacts[index].firstName = 'Tony';
like image 89
dakamojo Avatar answered Sep 23 '22 07:09

dakamojo