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

>Solution :

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

Leave a Reply