prefer_expression_function_bodies

Group: style

Maturity: stable

Dart SDK: >= 2.0.0 • (Linter v0.1.30)

View the Project on GitHub dart-lang/linter

CONSIDER using => for short members whose body is a single return statement.

BAD:

get width {
  return right - left;
}

BAD:

bool ready(num time) {
  return minTime == null || minTime <= time;
}

BAD:

containsValue(String value) {
  return getValues().contains(value);
}

GOOD:

get width => right - left;

GOOD:

bool ready(num time) => minTime == null || minTime <= time;

GOOD:

containsValue(String value) => getValues().contains(value);