반응형
문제 상황 (problem situation)
firebase_auth 버전에 따라 current user 정보를 가져오는 과정이 다릅니다.
(The process of getting current user information differs depending on the firebase_auth version.)
해결 방법 (Resolution)
> firebase_auth v0.18.0 이후 (Since firebase_auth v0.18.0)
final FirebaseAuth auth = FirebaseAuth.instance;
void inputData() {
final User user = auth.currentUser;
final uid = user.uid;
// here you write the codes to input the data into firestore
}
> firebase_auth v0.18.0 이전 (before firebase_auth v0.18.0)
final FirebaseAuth auth = FirebaseAuth.instance;
Future<void> inputData() async {
final FirebaseUser user = await auth.currentUser();
final uid = user.uid;
// here you write the codes to input the data into firestore
}
관련 검색 결과 (Related Search Results)
반응형