Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:firebase_auth/firebase_auth.dart';
- class AuthService{
- final FirebaseAuth _auth=FirebaseAuth.instance;
- //create user obj based on FirebaseUser
- UserF? _userFromFirebaseUser(User user){
- return user!=null? UserF(uid:user!.uid):null;
- }
- //anon sign in
- Future signInAnon() async{
- try{
- UserCredential result=await _auth.signInAnonymously();
- User? user=result.user;
- return user;
- }catch(e) {
- print(e.toString());
- return null;
- }
- }
- //email sign in
- //register email
- //sign out
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement