Flutter FirebaseFirestore : Google SignOut

flutterkage2k·2021년 6월 15일
0

flutter

목록 보기
6/11
post-thumbnail

Flutter FirebaseFirestore Google SignOut

pubspec.yaml add google_sign_in: & firebase_auth

I use version google_sign_in: ^5.0.4 & firebase_auth: ^1.4.1

ex) home.dart

import 'package:firebase_auth/firebase_auth.dart';
import 'package:google_sign_in/google_sign_in.dart';

final GoogleSignIn _googleSignIn = GoogleSignIn();


Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar( 
        actions: <Widget>[
          IconButton(
            icon: Icon(Icons.exit_to_app),
            color: Colors.black,
            onPressed: () {
              // 로그아웃
              FirebaseAuth.instance.signOut();
              _googleSignIn.signOut();
            },
          )
        ],
      ),


End
⊙^⊙ Thank For Reading | Happy Coding ⊙-⊙

The referrer gets a free month, up to a maximum of six months, for each friend who creates an account and signs in on their Mac.

Setapp_Logo.png

도움이 되셨다면, 커피 한잔 사주세요

buymeacoffee.png

0개의 댓글