getUID static method
If the user is logged in, you can request the UID using this function.
Implementation
static Future<String> getUID() async {
final FirebaseAuth auth = FirebaseAuth.instance;
String uid = auth.currentUser!.uid;
return uid;
}