Using final for Dart parameters Using final for Dart parameters dart dart

Using final for Dart parameters


I think most people don't care, and just write nothing because it's shorter.Adding a "final" will catch you assigning to a parameter inadvertently, but I guess that's just not something that happens often enough to be worth the overhead.

I would loathe to have a style guide that requires me to write "final " in front of all my parameters. If I don't assign to it anywhere, I'd expect the compiler to recognize the parameter as effectively being constant (in case there is any performance difference).