Is it possible to bind shareprefrences by Getx into some classes? I create a class like this:
class SplashBinding implements Bindings {
@override
void dependencies() {
Get.lazyPut<SplashLocalDataSource>(() {
final sharedPreferences = SharedPreferences.getInstance();
return awaitSplashLocalDataSource(// inject here )
});
}
}
I want to inject shareprefrences into awaitSplashLocalDataSource constructor. SharedPreferences.getInstance() return a future . Should I inject future of sharedPreferences or It is possible to inject sharedPreferences reference ?
use to be I used Injecteble package and I inject sharedPreferences by @preResolve annotation but in getx how can I do that?