enable lint prefer_final_in_for_each (#47724)
This commit is contained in:
committed by
GitHub
parent
fa337f5922
commit
4f9b6cf017
@@ -146,7 +146,7 @@ class AnimatedBezierState extends State<AnimatedBezier>
|
||||
|
||||
path.moveTo(100.0, 97.0);
|
||||
|
||||
for (Point p in pointList[0]) {
|
||||
for (final Point p in pointList[0]) {
|
||||
path.lineTo(p.x, p.y);
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ class AnimatedBezierState extends State<AnimatedBezier>
|
||||
|
||||
bezier2Path.moveTo(0.0, 70.55);
|
||||
|
||||
for (Point p in pointList[1]) {
|
||||
for (final Point p in pointList[1]) {
|
||||
bezier2Path.lineTo(p.x, p.y);
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ class AnimatedBezierState extends State<AnimatedBezier>
|
||||
|
||||
bezier3Path.moveTo(0.0, 69.48);
|
||||
|
||||
for (Point p in pointList[2]) {
|
||||
for (final Point p in pointList[2]) {
|
||||
bezier3Path.lineTo(p.x, p.y);
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ class AnimatedBezierState extends State<AnimatedBezier>
|
||||
|
||||
bezier4Path.moveTo(0.0, 69.48);
|
||||
|
||||
for (Point p in pointList[3]) {
|
||||
for (final Point p in pointList[3]) {
|
||||
bezier4Path.lineTo(p.x, p.y);
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ class AnimatedBezierState extends State<AnimatedBezier>
|
||||
}
|
||||
|
||||
List<PathDetail> _playReversed() {
|
||||
for (List<Point> list in pointList) {
|
||||
for (final List<Point> list in pointList) {
|
||||
if (list.isNotEmpty) {
|
||||
list.removeLast();
|
||||
}
|
||||
@@ -232,7 +232,7 @@ class AnimatedBezierState extends State<AnimatedBezier>
|
||||
|
||||
path.moveTo(100.0, 97.0);
|
||||
|
||||
for (Point point in points) {
|
||||
for (final Point point in points) {
|
||||
path.lineTo(point.x, point.y);
|
||||
}
|
||||
|
||||
@@ -240,14 +240,14 @@ class AnimatedBezierState extends State<AnimatedBezier>
|
||||
|
||||
bezier2Path.moveTo(0.0, 70.55);
|
||||
|
||||
for (Point p in pointList[1]) {
|
||||
for (final Point p in pointList[1]) {
|
||||
bezier2Path.lineTo(p.x, p.y);
|
||||
}
|
||||
|
||||
final Path bezier3Path = Path();
|
||||
bezier3Path.moveTo(0.0, 69.48);
|
||||
|
||||
for (Point p in pointList[2]) {
|
||||
for (final Point p in pointList[2]) {
|
||||
bezier3Path.lineTo(p.x, p.y);
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ class AnimatedBezierState extends State<AnimatedBezier>
|
||||
|
||||
bezier4Path.moveTo(0.0, 69.48);
|
||||
|
||||
for (Point p in pointList[3]) {
|
||||
for (final Point p in pointList[3]) {
|
||||
bezier4Path.lineTo(p.x, p.y);
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ class AnimatedBezierState extends State<AnimatedBezier>
|
||||
void playAnimation() {
|
||||
isPlaying = true;
|
||||
isReversed = false;
|
||||
for (List<Point> list in pointList) {
|
||||
for (final List<Point> list in pointList) {
|
||||
list.clear();
|
||||
}
|
||||
controller.reset();
|
||||
@@ -297,7 +297,7 @@ class AnimatedBezierState extends State<AnimatedBezier>
|
||||
void stopAnimation() {
|
||||
isPlaying = false;
|
||||
controller.stop();
|
||||
for (List<Point> list in pointList) {
|
||||
for (final List<Point> list in pointList) {
|
||||
list.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ class BenchmarkResultPrinter {
|
||||
|
||||
String _printJson() {
|
||||
final Map<String, double> results = <String, double>{};
|
||||
for (_BenchmarkResult result in _results) {
|
||||
for (final _BenchmarkResult result in _results) {
|
||||
results[result.name] = result.value;
|
||||
}
|
||||
return json.encode(results);
|
||||
@@ -59,7 +59,7 @@ class BenchmarkResultPrinter {
|
||||
|
||||
String _printPlainText() {
|
||||
final StringBuffer buf = StringBuffer();
|
||||
for (_BenchmarkResult result in _results) {
|
||||
for (final _BenchmarkResult result in _results) {
|
||||
buf.writeln('${result.description}: ${result.value.toStringAsFixed(1)} ${result.unit}');
|
||||
}
|
||||
return buf.toString();
|
||||
|
||||
@@ -16,7 +16,7 @@ void main() {
|
||||
print('Velocity tracker benchmark...');
|
||||
watch.start();
|
||||
for (int i = 0; i < _kNumIters; i += 1) {
|
||||
for (PointerEvent event in velocityEventData) {
|
||||
for (final PointerEvent event in velocityEventData) {
|
||||
if (event is PointerDownEvent || event is PointerMoveEvent)
|
||||
tracker.addPosition(event.timeStamp, event.position);
|
||||
if (event is PointerUpEvent)
|
||||
|
||||
@@ -84,7 +84,7 @@ Iterable<int> generateIterableList() {
|
||||
|
||||
int sumIterable(Iterable<int> values) {
|
||||
int result = 0;
|
||||
for (int value in values) {
|
||||
for (final int value in values) {
|
||||
result += value;
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -71,7 +71,7 @@ void main() {
|
||||
|
||||
String consumeSpan(Iterable<InlineSpanSemanticsInformation> items) {
|
||||
String result = '';
|
||||
for (InlineSpanSemanticsInformation span in items) {
|
||||
for (final InlineSpanSemanticsInformation span in items) {
|
||||
result += span.text;
|
||||
}
|
||||
return result;
|
||||
@@ -81,7 +81,7 @@ String consumeSpan(Iterable<InlineSpanSemanticsInformation> items) {
|
||||
Iterable<InlineSpanSemanticsInformation> combineSemanticsInfoSyncStar(List<InlineSpanSemanticsInformation> inputs) sync* {
|
||||
String workingText = '';
|
||||
String workingLabel;
|
||||
for (InlineSpanSemanticsInformation info in inputs) {
|
||||
for (final InlineSpanSemanticsInformation info in inputs) {
|
||||
if (info.requiresOwnNode) {
|
||||
if (workingText != null) {
|
||||
yield InlineSpanSemanticsInformation(workingText, semanticsLabel: workingLabel ?? workingText);
|
||||
@@ -110,7 +110,7 @@ Iterable<InlineSpanSemanticsInformation> combineSemanticsInfoList(List<InlineSpa
|
||||
String workingText = '';
|
||||
String workingLabel;
|
||||
final List<InlineSpanSemanticsInformation> result = <InlineSpanSemanticsInformation>[];
|
||||
for (InlineSpanSemanticsInformation info in inputs) {
|
||||
for (final InlineSpanSemanticsInformation info in inputs) {
|
||||
if (info.requiresOwnNode) {
|
||||
if (workingText != null) {
|
||||
result.add(InlineSpanSemanticsInformation(workingText, semanticsLabel: workingLabel ?? workingText));
|
||||
|
||||
Reference in New Issue
Block a user