Closed AlexProductions closed 1 year ago
The example given in the dartdoc of select works.
The issue with mutable state + select generally arises when returning a mutable object in the selector, such as a list.
provider.select((value) => value.someMutableList);
Then, when the list is mutated, providers wouldn't rebuild
Closing as there's technically nothing wrong
Describe what scenario you think is uncovered by the existing examples/articles The current documentation of provider.select() does not match in relation to ChangeNotifierProvider
The riverpod.dev docs say, using provider.select on ChangeNotifierProvider will not work, whereas the inline documentation of the function explicitly shows an example with the ChangeNotifierProvider
From Riverpod v2 Doc - ChangeNotifier
From Riverpod inline documentation of Package flutter_riverpod: ^2.3.6
The following are longer extractions of the Documentations mentioned above to faster get in context without needing to check the ressouces.
... from riverpod.dev v2 (link above):
... Inline Documentation: