solid-software / solid_lints

🟧 Lints for Dart and Flutter based on software industry standards and best practices.
Other
36 stars 17 forks source link

Prefer `late final` over `initState` #148

Open danylo-safonov-solid opened 3 months ago

danylo-safonov-solid commented 3 months ago
class SomeState extends State<Some> {
   final X? x;

   void initState() {
      x = widget.x;
    }

}

Can be

class SomeState extends State<Some> {
   late final x = widget.x;
}