-
Notifications
You must be signed in to change notification settings - Fork 754
Description
Page URL
https://dart.dev/tools/linter-rules/parameter_assignments
Page source
No response
Describe the problem
The documentation at https://dart.dev/tools/linter-rules/parameter_assignments seems to have several elements that weren't updated when null safety was introduced.
For example, badFunction contains a null-aware assignment to the parameter optional, but the type of this parameter is non-nullable (which will give rise to a warning on that assignment). Also, this assignment will never have an effect because optional is never null, which also detracts from the value of the example. Also, the default value is specified using : which has been replaced by = already several versions ago.
Similar issues exist with other examples on this page.
Expected fix
The code should be updated to take null safety into account such that each good example has no diagnostics and each bad example has just the diagnostic which is being documented on this page.
Additional context
No response
I would like to fix this problem.
- I will try and fix this problem on dart.dev.