riverpod
riverpod copied to clipboard
A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
Bad: ```dart @riverpod int a(ARef ref) => ref.watch(aProvider); ``` Good: ```dart // Not a circular dependency, as the "id" may change @riverpod int a(ARef ref, {required int id}) => ref.watch(aProvider,...
This requires making providers consts, but should be doable.
Some providers currently use `identical` while some use `==` We should unify this, whatever the decision is. It's probably worth making a benchmark about the cost of using `==`
Going from `AsyncData(42)` to `AsyncData(42)` shouldn't notify listeners. This originally was optimized but probably doesn't make sense after all. Should StreamProvider do the same?
if we request widgets to do: ```dart // List all the scoped providers they use @Scopes([scopedProvider]) class MyWidget extends ConsumerWidget { build(c, ref) { ref.watch(nonScopedProvider); ref.watch(scopedProvider); } } ``` We...
Bad: ```dart Button( onPressed: () { showDialog(builder: (_) => ref.watch(...), }, ) ``` Good: ```dart Button( onPressed: () { showDialog(builder: (_) =>Consumer(builder: (_, ref, __) => ref.watch(...) ), }, )...
Bad: ```dart class ExampleMock extends Mock implements Example ``` Good: ```dart class ExampleMock extends Notifier with Mock implements Example ```
cf title Although generally this isn't needed, there isn't really a reason to deny such a feature.
**Describe what scenario you think is uncovered by the existing examples/articles** https://riverpod.dev/docs/concepts/reading **Describe why existing examples/articles do not cover this case** Section "Reading a Provider" doesn't cover case of using...
## Related Issues Changed from **invididual** to **individual** in `docs/advanced/select.mdx` doc ## Checklist Before you create this PR confirm that it meets all requirements listed below by checking the relevant...