Declaring Riverpod Providers with Ref

 Declaring Riverpod Providers with Ref


Did you know?

Since Riverpod 2.6.0, all generated providers can be declared with a Ref argument.

The old [ProviderName]Ref syntax is deprecated.

To upgrade existing projects, simply run: dart run custom_lint --fix. 👍



Note: in order to update all providers in your codebase, custom_lint needs to be installed and configured:

# pubspec.yaml dev_dependencies: custom_lint: 0.7.0 riverpod_lint: 2.6.2
# analysis_options.yaml analyzer: plugins: - custom_lint

Once this is done, run: dart run custom_lint --fix.

Happy coding!

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

How to extract filename from Uri?

Now, we can extract filename with and without extension :) You will convert your bitmap to uri and get the real path of your file. Now w...