Pattern: Missing use of =>
Issue: -
CONSIDER using =>
for short members whose body is a single return statement.
Example of incorrect code:
get width {
return right - left;
}
Example of incorrect code:
bool ready(num time) {
return minTime == null || minTime <= time;
}
Example of incorrect code:
containsValue(String value) {
return getValues().contains(value);
}
Example of correct code:
get width => right - left;
Example of correct code:
bool ready(num time) => minTime == null || minTime <= time;
Example of correct code:
containsValue(String value) => getValues().contains(value);