Advertisement
Guest User

Dart linter - sort_constructor_first

a guest
Dec 28th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.34 KB | None | 0 0
  1. // According to the Dart language linter this is considered better:
  2.  
  3. // Define constructor before declaring fields
  4. class Something {
  5.   Something(this.value);
  6.   final double value;
  7.   ...
  8. }
  9.  
  10. // For me, this is more natural:
  11. // Declare fields before the constructor
  12.  
  13. class Something {
  14.   final double value;
  15.   Something(this.value);
  16.   ...
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement