We will store additional information about the user when the sign in or register, eg. bio, preference etc.
```dart
final _firestore = FirebaseFirestore.instance;
Future<void> createNewUserData() async {
_firestore.collection('users').doc(_auth.currentUser?.uid).set({
'name': 'Mentee',
'uid': _auth.currentUser?.uid,
'bio': 'Flutter Devcamp Mentee',
'completed': [],
'recents': [],
'badges': [],
'certificates': [],
'profilePic': ''
});
}
```
Let's get the courses from the database widgets => explore_course_list.dart add a field variable
final _firestore = FirebaseFirestore.instance;
void getCourses() {
_firestore.collection("courses").get().then((snapshot) {
snapshot.docs.forEach((doc) {
setState(() {
courses.add(Course(
courseTitle: doc["courseTitle"],
courseSubtitle: doc["courseSubtitle"],
illustration: doc["illustration"],
logo: doc["logo"],
background: LinearGradient(colors: [
Color(int.parse(doc["color"][0])),
Color(int.parse(doc["color"][1])),
]),
videoUrl: doc["videoUrl"]));
});
});
});
}