updateProfile method

void updateProfile(
  1. int index,
  2. Profile u
)

Receives a profile u and saves it in the index position of profilesList and calls notifyListeners

Implementation

void updateProfile(int index, Profile u){
  profilesList[index] = u;
  notifyListeners();
}