Advertisement
arvind_iyer_2001

Untitled

Jul 29th, 2021
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.55 KB | None | 0 0
  1. import 'package:firebase_auth/firebase_auth.dart';
  2.  
  3. class AuthService{
  4.   final FirebaseAuth _auth=FirebaseAuth.instance;
  5.   //create user obj based on FirebaseUser
  6.  
  7.   UserF? _userFromFirebaseUser(User user){
  8.     return user!=null? UserF(uid:user!.uid):null;
  9.   }
  10.  
  11.   //anon sign in
  12. Future signInAnon() async{
  13.   try{
  14.     UserCredential result=await _auth.signInAnonymously();
  15.     User? user=result.user;
  16.     return user;
  17.   }catch(e) {
  18.   print(e.toString());
  19.   return null;
  20.   }
  21.  
  22. }
  23.   //email sign in
  24.  
  25.   //register email
  26.  
  27.   //sign out
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement