I'm learning Dart and I understand that the below (should be) correct. I now want to understand how to do the shorthand version of this. This function lives in my state container (inherited widget) so that I can call this anywhere in my app. Hopefully calling this function everywhere in my app doesn't count as multiple Firestore queries...
String getUID() {
final uid = FirebaseAuth.instance.currentUser?.uid.toString();
if (uid == null || uid == '') {
return '';
} else {
return uid;
}
}