I have defined all the required arguments. But still getting the below error:
1 positional argument expected by ‘AuthStateLoggedOut.new’, but 0 found.
Try adding the missing argument.
This is my AuthStateLoggedOut Class:
class AuthStateLoggedOut extends AuthState with EquatableMixin{
final Exception? exception;
final bool isLoading;
const AuthStateLoggedOut(Exception? e, {required this.exception, required this.isLoading});
@override
List<Object?> get props => [exception, isLoading];
}
This is my AuthEventInitialize function:
``on<AuthEventInitialize>((event, emit )async{
await provider.initialize();
final user = provider.currentUser;
if(user == null){
emit(const AuthStateLoggedOut(exception: null, isLoading:false,));
} else if(!user.isEmailVerified){
emit(const AuthStateNeedsVerification());
} else{
emit(AuthStateLoggedIn(user));
}
});``