Should I inject an interface or its implementation ?
I came across the below code in a tutorial and I am wondering why inject the interface but register it as its implementation when you can just directly inject its implementation?
SIGNINBLOC
@injectable
class SignInBloc extends Bloc<SignInEvent, SignInState> {
final IAuthFacade _authFacade;
SignInBloc(this._authFacade) : super(SignInState.initial());
FIREBASEAUTH
@LazySingleton(as: IAuthFacade)
class FirebaseAuthFacade implements IAuthFacade {
INJECTION CONFIG
gh.lazySingleton<IAuthFacade>(
() => FirebaseAuthFacade(get<FirebaseAuth>(), get<GoogleSignIn>()));