Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Flutter Class Auth error; When I'm creating this class I'm experiencing undefined class error

I was creating a class but I’m experiencing error as below. I do not understand I’m experiencing this error. I’ve added picture to see the error visually.

    import 'package:firebase_auth/firebase_auth.dart';

Class Auth {
  final FirebaseAuth firebaseAuth = FirebaseAuth.instance;
  User? get currentUser => firebaseAuth.currentUser;
  
  Stream<User?> get authStateChanges => firebaseAuth.authStateChanges();

  Future<void> signIn({
    required String email,
    required String password,
  }) async {
    await firebaseAuth.signInWithEmailAndPassword(
      email: email, 
      password: password,);
  }

  Future<void> createAccount({
    required String email,
    required String password,
  }) async{
    await firebaseAuth.createUserWithEmailAndPassword(
      email: email, 
      password: password,);
  }

  Future<void> signOut() async {
    await firebaseAuth.signOut();
  }
}

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You mentioned Class, but class is case sensitive with lower case.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading