Created
January 6, 2022 06:58
-
-
Save syossan27/d5b53f8fc3e173c1b2f95518e13ff578 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:firebase_auth/firebase_auth.dart'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
void main() { | |
// アプリの初回起動チェック | |
// 初回起動ならログアウト | |
final prefs = await SharedPreferences.getInstance(); | |
if (prefs.getBool('first_launch') ?? true) { | |
final FirebaseAuth auth = FirebaseAuth.instance; | |
await auth.signOut(); | |
prefs.setBool('first_launch', false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment