import 'package:firebase_auth/firebase_auth.dart';
import 'package:woofnwalk/providers/utils.dart';
class AuthenticateService{
final FirebaseAuth _auth;
AuthenticateService(this._auth);
Stream<User?> get authStateChanges => _auth.idTokenChanges();
Future<String> login(String email, String password) async{
try{
await _auth.signInWithEmailAndPassword(email: email, password: password);
return "Loggged In";
}catch(e){
return e.toString();
}
}
Future<String> signUp(String email, String password) async{
try{
await _auth.createUserWithEmailAndPassword(email: email, password: password);
return "Signed Up";
}catch(e){
Utils.showSnackBar(e.toString());
return e.toString();
}
}
}