Declare locals as final where not reassigned (dev) (#8574)
This commit is contained in:
@@ -449,7 +449,7 @@ class ItemGalleryBox extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<String> tabNames = <String>[
|
||||
final List<String> tabNames = <String>[
|
||||
'A', 'B', 'C', 'D'
|
||||
];
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ void main() {
|
||||
});
|
||||
|
||||
test('measure', () async {
|
||||
Timeline timeline = await driver.traceAction(() async {
|
||||
final Timeline timeline = await driver.traceAction(() async {
|
||||
// Find the scrollable stock list
|
||||
SerializableFinder stockList = find.byValueKey('main-scroll');
|
||||
final SerializableFinder stockList = find.byValueKey('main-scroll');
|
||||
expect(stockList, isNotNull);
|
||||
|
||||
// Scroll down
|
||||
@@ -38,7 +38,7 @@ void main() {
|
||||
}
|
||||
});
|
||||
|
||||
TimelineSummary summary = new TimelineSummary.summarize(timeline);
|
||||
final TimelineSummary summary = new TimelineSummary.summarize(timeline);
|
||||
summary.writeSummaryToFile('complex_layout_scroll_perf', pretty: true);
|
||||
summary.writeTimelineToFile('complex_layout_scroll_perf', pretty: true);
|
||||
});
|
||||
|
||||
@@ -54,7 +54,7 @@ class BenchmarkResultPrinter {
|
||||
}
|
||||
|
||||
String _printPlainText() {
|
||||
StringBuffer buf = new StringBuffer();
|
||||
final StringBuffer buf = new StringBuffer();
|
||||
for (_BenchmarkResult result in _results) {
|
||||
buf.writeln('${result.description}: ${result.value.toStringAsFixed(1)} ${result.unit}');
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ void main() {
|
||||
}
|
||||
watch.stop();
|
||||
|
||||
BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
|
||||
final BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
|
||||
printer.addResult(
|
||||
description: 'Velocity tracker',
|
||||
value: watch.elapsedMicroseconds / _kNumIters,
|
||||
|
||||
@@ -75,7 +75,7 @@ Future<Null> main() async {
|
||||
}
|
||||
});
|
||||
|
||||
BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
|
||||
final BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
|
||||
printer.addResult(
|
||||
description: 'Stock animation',
|
||||
value: wallClockWatch.elapsedMicroseconds / (1000 * 1000),
|
||||
|
||||
@@ -21,7 +21,7 @@ Future<Null> main() async {
|
||||
|
||||
// This allows us to call onBeginFrame even when the engine didn't request it,
|
||||
// and have it actually do something:
|
||||
LiveTestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized();
|
||||
final LiveTestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized();
|
||||
binding.allowAllFrames = true;
|
||||
|
||||
final Stopwatch watch = new Stopwatch();
|
||||
@@ -50,7 +50,7 @@ Future<Null> main() async {
|
||||
watch.stop();
|
||||
});
|
||||
|
||||
BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
|
||||
final BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
|
||||
printer.addResult(
|
||||
description: 'Stock build',
|
||||
value: watch.elapsedMicroseconds / iterations,
|
||||
|
||||
@@ -20,7 +20,7 @@ Future<Null> main() async {
|
||||
|
||||
// This allows us to call onBeginFrame even when the engine didn't request it,
|
||||
// and have it actually do something:
|
||||
LiveTestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized();
|
||||
final LiveTestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized();
|
||||
binding.allowAllFrames = true;
|
||||
|
||||
final Stopwatch watch = new Stopwatch();
|
||||
@@ -51,7 +51,7 @@ Future<Null> main() async {
|
||||
watch.stop();
|
||||
});
|
||||
|
||||
BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
|
||||
final BenchmarkResultPrinter printer = new BenchmarkResultPrinter();
|
||||
printer.addResult(
|
||||
description: 'Stock layout',
|
||||
value: watch.elapsedMicroseconds / iterations,
|
||||
|
||||
Reference in New Issue
Block a user