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 8 months ago

danylo-safonov-solid commented 8 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;
}