Skip to content

[riverpod_generator] how to override provider which generated from riverpod_generator #2501

Answered by rrousselGit
drown0315 asked this question in Q&A
Discussion options

You must be logged in to vote

Like non-generated providers:

// For classes:
@riverpod
class Example extends _$Example {
  int build() => 0;
}

exampleProvider.overrideWith(() => Example());

// For functions:
@riverpod
int example(ExampleRef ref) => 0;

exampleProvider.overrideWith((ref) => 0);

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
5 replies
@drown0315
Comment options

@artahc
Comment options

@AAverin
Comment options

@rrousselGit
Comment options

@AAverin
Comment options

Answer selected by rrousselGit
Comment options

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

@marlonmartina
Comment options

@dustin-graham
Comment options

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