Dagger2 Allow Injection To Be Null
So, in short, I have a lot of flavors of the same app with slight differences. I would like to add a Navigator for all flavors independently. I'm using Dagger2, and I have a sub co
Solution 1:
To support a nullable type you just have to add a @Nullable
annotation on your @Provides
method that returns the nullable type and Dagger will accept it.
If you don't, Dagger will complain that you can only provide nullable types from @Nullable
annotated methods.
Post a Comment for "Dagger2 Allow Injection To Be Null"