I want to get the current uid of user with flutter.
I have tried following but returns an error
final FirebaseAuth auth = FirebaseAuth.instance;
void inputData() {
final User user = auth.currentUser;
final uid = user.uid;
print(uid);
// here you write the codes to input the data into firestore
}
Error:
════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
[core/no-app] No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()