相关文章推荐
Dart 3.2 blog post ! This release brings enhancements to type promotion, interop capabilities, DevTools, and more.

Sort constructor declarations before other members.

This rule is available as of Dart 2.0.0.

This rule has a quick fix available.

Details

DO sort constructor declarations before other members.

abstract class Visitor {
  double value;
  visitSomething(Something s);
  Visitor();

GOOD:

abstract class Animation<T> {
  const Animation(this.value);
  double value;
  void addListener(VoidCallback listener);
Usage

To enable the sort_constructors_first rule, add sort_constructors_first under linter > rules in your analysis_options.yaml file:

linter:
  rules:
    - sort_constructors_first
      Except as otherwise noted, this site is licensed under a
      Creative Commons Attribution 4.0 International License,
      and code samples are licensed under the
      3-Clause BSD License.
        
  • Terms
  • Privacy
  • Security
  •  
    推荐文章