Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: wrong registration order #475

Open
ChaserVasya opened this issue Aug 26, 2024 · 3 comments
Open

Bug: wrong registration order #475

ChaserVasya opened this issue Aug 26, 2024 · 3 comments

Comments

@ChaserVasya
Copy link

When I run not dev flavor error is threw.

const String _dev = 'dev';
const String _prod = 'prod';
const String _test = 'test';
const String _odin = 'odin';
...
    gh.factory<_i201.FlavorConfig>(
      () => flavorsModule.devFlavor,
      registerFor: {_dev},
    );
    await gh.singletonAsync<_i743.LocalStorage>(
      () => customInitModule.storage(
        gh<_i201.FlavorConfig>(), // Bad state: GetIt: Object/factory with type FlavorConfig is not registered inside GetIt
        gh<_i460.SharedPreferences>(),
      ),
      preResolve: true,
    );
    gh.factory<_i201.FlavorConfig>(
      () => flavorsModule.testFlavor,
      registerFor: {_test},
    );
    gh.factory<_i201.FlavorConfig>(
      () => flavorsModule.prodFlavor,
      registerFor: {_prod},
    );
    gh.factory<_i201.FlavorConfig>(
      () => flavorsModule.odinFlavor,
      registerFor: {_odin},
    );
...

context

injectable: 2.4.4
injectable_generator: 2.6.2

@ghost
Copy link

ghost commented Aug 26, 2024

I'm sorry! I didn't do this!! It seems to be something not good just don't click it my apology!!!

@ghost
Copy link

ghost commented Aug 26, 2024

I don't know what it is either!!!

@nowrose-ragib
Copy link

Same issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@ChaserVasya @nowrose-ragib and others