'Bloc depends on unregistered type - Injectable

I'm using injectable lib according to a tutorial in youtube some of annotations replaced. but I visit injectable lib in pub.dev look to the changelog and replaced > RegisterAs(Type) by > Injectable(as:Type) but it not working and give unregistered error

abstract class IAuthFacade {
  Future<Either<AuthFailure, Unit>> registerWithEmailAndPassword(
      {required EmailAddress emailAddress, required Password password});
  Future<Either<AuthFailure, Unit>> signInWithEmailAndPassword(
      {required EmailAddress emailAddress, required Password password});
  Future<Either<AuthFailure, Unit>> signInWithGoogle();
}

And here I implemented the Interface

@lazySingleton
@Injectable(as: IAuthFacade)
class FirebaseAuthFacade implements IAuthFacade {
  final FirebaseAuth _auth;

  FirebaseAuthFacade(this._auth);

  @override
  Future<Either<AuthFailure, Unit>> registerWithEmailAndPassword({required EmailAddress emailAddress, required Password password}) {
    // TODO: implement registerWithEmailAndPassword
    throw UnimplementedError();
  }

  @override
  Future<Either<AuthFailure, Unit>> signInWithEmailAndPassword({required EmailAddress emailAddress, required Password password}) {
    // TODO: implement signInWithEmailAndPassword
    throw UnimplementedError();
  }

  @override
  Future<Either<AuthFailure, Unit>> signInWithGoogle() {
    // TODO: implement signInWithGoogle
    throw UnimplementedError();
  }
}

And here is the bloc

@injectable
class SignInFormBloc extends Bloc<SignInFormEvent, SignInFormState> {
  final IAuthFacade _authFacade;
}

After building it shows me

Missing dependencies in sabaclassesorganizer/injection.dart

[SignInFormBloc] depends on unregistered type [IAuthFacade] from package:sabaclassesorganizer/domain/auth/i_auth_facade.dart

Did you forget to annotate the above class(s) or their implementation with @injectable?
or add the right environment keys?
------------------------------------------------------------------------



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source