Firebase Authenticationへの登録
FirebaseAuth firebaseAuth = FirebaseAuth.instance;
DatabaseReference dbRef = FirebaseDatabase.instance.reference().child('Users');
firebaseAuth
.createUserWithEmailAndPassword(
email: emailController.text,
password: passwordController.text).then((result){
dbRef.child(result.user.uid).set({
'email': emailController.text,
})
Firebase Authenticationへのログイン
FirebaseAuth firebaseAuth = FirebaseAuth.instance;
firebaseAuth.signInWithEmailAndPassword(
email: emailController.text,
password: passwordController.text)
.then((result){
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (context) => HomePage(uid: result.user.uid)),
);
})
Firebase Authentication存在確認
FirebaseAuth.instance.currentUser().then((response) { }
Firebase Authenticationログアウト
FirebaseAuth auth = FirebaseAuth.instance;
auth.signOut().then((response){}