I have a class called Consultant where I collect data from the user for my app.
class Consultant {
final int id;
final String consultantFirstName;
final String consultantLastName;
final String consultantNickName;
final String consultantImageProfile;
final String consultantCategory;
final String consultantDescription;
final String consultantLikes;
final String consultantReviews;
final String consultantStars;
final String consultantPrice;
final String consultantExperience;
const Consultant({
this.id,
this.consultantFirstName,
this.consultantLastName,
this.consultantNickName,
this.consultantImageProfile,
this.consultantCategory,
this.consultantDescription,
this.consultantLikes,
this.consultantReviews,
this.consultantStars,
this.consultantPrice,
this.consultantExperience,
});
}
this below is an example of one of my user:
final Consultant marco = Consultant(
id: 1,
consultantFirstName: 'Marco',
consultantLastName: 'Marcello',
consultantNickName: 'Tarot and Dreams',
consultantCategory: 'Tarocchi',
consultantDescription: 'Ciao a tutti sono Rocco',
consultantImageProfile: 'assets/images/rocco.jpg',
consultantLikes: '2342',
consultantReviews: '76245',
consultantPrice: '3.90',
consultantExperience: '12',
);
List<Consultant> consultant = [
marco,
carmela,
sabrina,
saverio,
pamela,
giovanni
];
ok all this user information will be retrieved into the right widget by:
consultant.[index].consultantDescription... etc..
at the moment all the information are into my class but I need to move to cloud firestore where I collect all the information of the user so I would use into my class something to use cloud firestore future to have the information dynamically added to my widget for example:
final Consultant user = Consultant(
id: 1,
consultantFirstName: data[here the documents from firestore],
consultantLastName: data[here the documents from firestore],
consultantNickName: data[here the documents from firestore],
consultantCategory: data[here the documents from firestore],
consultantDescription: data[here the documents from firestore],
consultantImageProfile: data[here the documents from firestore],
etc...
);
this will allow me to grab the information from database and push to the right widget is that possible?