Skip to content

How to make a run-time error when using a Scoped Provider that is not overridden? #3667

Answered by snapsl
hisaichi5518 asked this question in Q&A
Discussion options

You must be logged in to vote

You can enforce this by overwriting in the root providerscope as follows

    ProviderScope(
      overrides: [
        countNotifierProvider.overrideWith(() => throw UnimplementedError()),
      ],
    );

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@hisaichi5518
Comment options

@snapsl
Comment options

@hisaichi5518
Comment options

Answer selected by hisaichi5518
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants