I have a stateless widget which I want a set of variable to change based on a conditional statement. Here is the conditional statement:
if(senderid != userid){
String fullName = list[index]['sender_fullname'];
String userName = list[index]['sender_username'];
String avatar = list[index]['sender_avatar'];
}else{
String fullName = list[index]['receiver_fullname'];
String userName = list[index]['receiver_username'];
String avatar = list[index]['receiver_avatar'];
}
I notice that the inital variables’ values didn’t change after using the conditional statement block to change their values.