Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classes and mixins can only implement other classes and mixins. Try specifying a class or mixin #12

Open
knitish23 opened this issue Feb 24, 2024 · 1 comment

Comments

@knitish23
Copy link

pls remove this error.

Classes and mixins can only implement other classes and mixins.
Try specifying a class or mixin, or remove the name from the list. in class auth_test.dart

class MockAuthProvider implements AuthProvider {
AuthUser? _user;
var _isInitialized = false;
bool get isInitialized => _isInitialized;
@OverRide
Future createUser({
required String email,
required String password,
}) async {
if (!isInitialized) throw NotInitializedException();
await Future.delayed(const Duration(seconds: 1));
return logIn(
email: email,
password: password,
);
}

@OverRide
AuthUser? get currentUser => _user;

@OverRide
Future initialize() async {
await Future.delayed(const Duration(seconds: 1));
_isInitialized = true;
}

@OverRide
Future logIn({
required String email,
required String password,
}) {
if (!isInitialized) throw NotInitializedException();
if (email == '[email protected]') throw UserNotFoundAuthException();
if (password == '12345') throw WrongPasswordAuthExeption();
const user = AuthUser(isEmailVerified: false);
_user = user;
return Future.value(user);
}

@OverRide
Future logOut() async {
if (!isInitialized) throw NotInitializedException();
if (_user == null) throw UserNotFoundAuthException();
await Future.delayed(const Duration(seconds: 1));
_user = null;
}

@OverRide
Future sendEmailVerification() async {
if (!isInitialized) throw NotInitializedException();
final user = _user;
if (user == null) throw UserNotFoundAuthException();
const newUser = AuthUser(isEmailVerified: true);
_user = newUser;
}
}

@JosephDaws
Copy link

I am having this error as well. Do we know when this will be fixed/what the cause of the error is?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants