Integrate package:flutter_lints into templates by goderbauer · Pull Request #81417 · flutter/flutter
I believe the fix for this landed in dart-lang/sdk (dart-lang/sdk@f193637) ~8 days ago, so should likely already be available in flutter/flutter.
While the fix has rolled into the engine, it's not available in flutter/flutter yet due to an unfortunate combination of engine rollbacks and tree closures. I believe the next engine roll into the framework will contain the fix, though, once the tree is open again.
My newly added tests is actually currently failing because the fix is not rolled in yet: https://github.com/flutter/flutter/pull/81417/checks?check_run_id=2520340935