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

7,840
class Person {
  String firstName;
  String lastName;
}
//assuming contacts is a List<Person>
contacts[index].firstName = 'Tony';
Share:
7,840
Admin
Author by

Admin

Updated on December 06, 2022

Comments

  • Admin
    Admin 15 minutes

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

  • Sukhchain Singh about 3 years
    We also need to use setState in order to change the data.