And How capitalize the displayName first element?
How I get the capital first letter of displayName of user, who just registered on my app and store the first letter in firestore.
Here is my code to store the data in firestore.
void updateUserData(FirebaseUser user) async {
DocumentReference ref = _db.collection('users').document(user.uid);
return ref.setData({
'uid': user.uid,
'email': user.email,
'photoURL': user.photoUrl,
'displayName': user.displayName,
'lastSeen': DateTime.now()
}, merge: true);
}
Eg Suppose displayName = richie, here what
I want to store a new key value pair in my document
firstletter = R
Thanks In Advance