vandadnp / mynotes-course

This is the GitHub repository of the MyNotes application for the Free Flutter Course (https://www.youtube.com/playlist?list=PL6yRaaP0WPkVtoeNIGqILtRAgd3h2CNpT)
537 stars 197 forks source link

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

Open knitish23 opened 6 months ago

knitish23 commented 6 months ago

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 == 'knitish241@gmail.com') 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 commented 4 months ago

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