diff --git a/packages/flutter_driver/lib/src/driver.dart b/packages/flutter_driver/lib/src/driver.dart index 2df7bf37df..e5b74cdea3 100644 --- a/packages/flutter_driver/lib/src/driver.dart +++ b/packages/flutter_driver/lib/src/driver.dart @@ -139,9 +139,9 @@ class FlutterDriver { // Connect to Dart VM servcies _log.info('Connecting to Flutter application at $dartVmServiceUrl'); - VMServiceClientConnection connection = await vmServiceConnectFunction(dartVmServiceUrl); - VMServiceClient client = connection.client; - VM vm = await client.getVM(); + final VMServiceClientConnection connection = await vmServiceConnectFunction(dartVmServiceUrl); + final VMServiceClient client = connection.client; + final VM vm = await client.getVM(); _log.trace('Looking for the isolate'); VMIsolate isolate = await vm.isolates.first.loadRunnable(); @@ -162,7 +162,7 @@ class FlutterDriver { isolate = await vm.isolates.first.loadRunnable(); } - FlutterDriver driver = new FlutterDriver.connectedTo( + final FlutterDriver driver = new FlutterDriver.connectedTo( client, connection.peer, isolate, printCommunication: printCommunication, logCommunicationToFile: logCommunicationToFile @@ -203,8 +203,8 @@ class FlutterDriver { // If the isolate is paused at the start, e.g. via the --start-paused // option, then the VM service extension is not registered yet. Wait for // it to be registered. - Future whenResumed = resumeLeniently(); - Future whenServiceExtensionReady = Future.any(>[ + final Future whenResumed = resumeLeniently(); + final Future whenServiceExtensionReady = Future.any(>[ waitForServiceExtension(), // We will never receive the extension event if the user does not // register it. If that happens time out. @@ -212,7 +212,7 @@ class FlutterDriver { ]); await whenResumed; _log.trace('Waiting for service extension'); - dynamic signal = await whenServiceExtensionReady; + final dynamic signal = await whenServiceExtensionReady; if (signal == 'timeout') { throw new DriverError( 'Timed out waiting for Flutter Driver extension to become available. ' @@ -239,7 +239,7 @@ class FlutterDriver { } // At this point the service extension must be installed. Verify it. - Health health = await driver.checkHealth(); + final Health health = await driver.checkHealth(); if (health.status != HealthStatus.ok) { await client.close(); throw new DriverError('Flutter application health check failed.'); @@ -265,7 +265,7 @@ class FlutterDriver { Future> _sendCommand(Command command) async { Map response; try { - Map serialized = command.serialize(); + final Map serialized = command.serialize(); _logCommunication('>>> $serialized'); response = await _appIsolate .invokeExtension(_kFlutterExtensionMethod, serialized) @@ -293,7 +293,7 @@ class FlutterDriver { if (_printCommunication) _log.info(message); if (_logCommunicationToFile) { - f.File file = fs.file(p.join(testOutputsDirectory, 'flutter_driver_commands_$_driverId.log')); + final f.File file = fs.file(p.join(testOutputsDirectory, 'flutter_driver_commands_$_driverId.log')); file.createSync(recursive: true); // no-op if file exists file.writeAsStringSync('${new DateTime.now()} $message\n', mode: f.FileMode.APPEND, flush: true); } @@ -329,7 +329,7 @@ class FlutterDriver { /// This command invokes the `onSubmitted` handler of the `Input` widget and /// the returns the submitted text value. Future submitInputText(SerializableFinder finder) async { - Map json = await _sendCommand(new SubmitInputText(finder)); + final Map json = await _sendCommand(new SubmitInputText(finder)); return json['text']; } @@ -378,7 +378,7 @@ class FlutterDriver { /// Take a screenshot. The image will be returned as a PNG. Future> screenshot() async { - Map result = await _peer.sendRequest('_flutter.screenshot'); + final Map result = await _peer.sendRequest('_flutter.screenshot'); return BASE64.decode(result['screenshot']); } @@ -402,7 +402,7 @@ class FlutterDriver { /// /// [getFlagList]: https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#getflaglist Future>> getVmFlags() async { - Map result = await _peer.sendRequest('getFlagList'); + final Map result = await _peer.sendRequest('getFlagList'); return result['flags']; } @@ -525,7 +525,7 @@ void restoreVmServiceConnectFunction() { /// /// Times out after 30 seconds. Future _waitAndConnect(String url) async { - Stopwatch timer = new Stopwatch()..start(); + final Stopwatch timer = new Stopwatch()..start(); Future attemptConnection() async { Uri uri = Uri.parse(url); diff --git a/packages/flutter_driver/lib/src/error.dart b/packages/flutter_driver/lib/src/error.dart index df9ff76ae6..8cc74e6ed9 100644 --- a/packages/flutter_driver/lib/src/error.dart +++ b/packages/flutter_driver/lib/src/error.dart @@ -39,7 +39,7 @@ final StreamController _logger = }); void _log(LogLevel level, String loggerName, Object message) { - LogRecord record = new LogRecord._(level, loggerName, '$message'); + final LogRecord record = new LogRecord._(level, loggerName, '$message'); // If nobody expressed interest in rerouting log messages somewhere specific, // print them to stderr. if (_noLogSubscribers) diff --git a/packages/flutter_driver/lib/src/extension.dart b/packages/flutter_driver/lib/src/extension.dart index 2331ee7be2..6649ff4fd7 100644 --- a/packages/flutter_driver/lib/src/extension.dart +++ b/packages/flutter_driver/lib/src/extension.dart @@ -29,7 +29,7 @@ class _DriverBinding extends WidgetsFlutterBinding { // TODO(ianh): refactor so @override void initServiceExtensions() { super.initServiceExtensions(); - FlutterDriverExtension extension = new FlutterDriverExtension(); + final FlutterDriverExtension extension = new FlutterDriverExtension(); registerServiceExtension( name: _extensionMethodName, callback: extension.call @@ -119,22 +119,22 @@ class FlutterDriverExtension { /// The returned JSON is command specific. Generally the caller deserializes /// the result into a subclass of [Result], but that's not strictly required. Future> call(Map params) async { - String commandKind = params['command']; + final String commandKind = params['command']; try { - CommandHandlerCallback commandHandler = _commandHandlers[commandKind]; - CommandDeserializerCallback commandDeserializer = + final CommandHandlerCallback commandHandler = _commandHandlers[commandKind]; + final CommandDeserializerCallback commandDeserializer = _commandDeserializers[commandKind]; if (commandHandler == null || commandDeserializer == null) throw 'Extension $_extensionMethod does not support command $commandKind'; - Command command = commandDeserializer(params); - Result response = await commandHandler(command).timeout(command.timeout); + final Command command = commandDeserializer(params); + final Result response = await commandHandler(command).timeout(command.timeout); return _makeResponse(response?.toJson()); } on TimeoutException catch (error, stackTrace) { - String msg = 'Timeout while executing $commandKind: $error\n$stackTrace'; + final String msg = 'Timeout while executing $commandKind: $error\n$stackTrace'; _log.error(msg); return _makeResponse(msg, isError: true); } catch (error, stackTrace) { - String msg = 'Uncaught extension error while executing $commandKind: $error\n$stackTrace'; + final String msg = 'Uncaught extension error while executing $commandKind: $error\n$stackTrace'; _log.error(msg); return _makeResponse(msg, isError: true); } @@ -185,7 +185,7 @@ class FlutterDriverExtension { Finder _createByTooltipMessageFinder(ByTooltipMessage arguments) { return find.byElementPredicate((Element element) { - Widget widget = element.widget; + final Widget widget = element.widget; if (widget is Tooltip) return widget.message == arguments.text; return false; @@ -204,7 +204,7 @@ class FlutterDriverExtension { } Finder _createFinder(SerializableFinder finder) { - FinderConstructor constructor = _finders[finder.finderType]; + final FinderConstructor constructor = _finders[finder.finderType]; if (constructor == null) throw 'Unsupported finder type: ${finder.finderType}'; @@ -213,13 +213,13 @@ class FlutterDriverExtension { } Future _tap(Command command) async { - Tap tapCommand = command; + final Tap tapCommand = command; await _prober.tap(await _waitForElement(_createFinder(tapCommand.finder))); return new TapResult(); } Future _waitFor(Command command) async { - WaitFor waitForCommand = command; + final WaitFor waitForCommand = command; if ((await _waitForElement(_createFinder(waitForCommand.finder))).evaluate().isNotEmpty) return new WaitForResult(); else @@ -232,15 +232,15 @@ class FlutterDriverExtension { } Future _scroll(Command command) async { - Scroll scrollCommand = command; - Finder target = await _waitForElement(_createFinder(scrollCommand.finder)); + final Scroll scrollCommand = command; + final Finder target = await _waitForElement(_createFinder(scrollCommand.finder)); final int totalMoves = scrollCommand.duration.inMicroseconds * scrollCommand.frequency ~/ Duration.MICROSECONDS_PER_SECOND; - Offset delta = new Offset(scrollCommand.dx, scrollCommand.dy) / totalMoves.toDouble(); - Duration pause = scrollCommand.duration ~/ totalMoves; - Point startLocation = _prober.getCenter(target); + final Offset delta = new Offset(scrollCommand.dx, scrollCommand.dy) / totalMoves.toDouble(); + final Duration pause = scrollCommand.duration ~/ totalMoves; + final Point startLocation = _prober.getCenter(target); Point currentLocation = startLocation; - TestPointer pointer = new TestPointer(1); - HitTestResult hitTest = new HitTestResult(); + final TestPointer pointer = new TestPointer(1); + final HitTestResult hitTest = new HitTestResult(); _prober.binding.hitTest(hitTest, startLocation); _prober.binding.dispatchEvent(pointer.down(startLocation), hitTest); @@ -256,38 +256,38 @@ class FlutterDriverExtension { } Future _scrollIntoView(Command command) async { - ScrollIntoView scrollIntoViewCommand = command; - Finder target = await _waitForElement(_createFinder(scrollIntoViewCommand.finder)); + final ScrollIntoView scrollIntoViewCommand = command; + final Finder target = await _waitForElement(_createFinder(scrollIntoViewCommand.finder)); await Scrollable.ensureVisible(target.evaluate().single, duration: const Duration(milliseconds: 100), alignment: scrollIntoViewCommand.alignment ?? 0.0); return new ScrollResult(); } Future _setInputText(Command command) async { - SetInputText setInputTextCommand = command; - Finder target = await _waitForElement(_createFinder(setInputTextCommand.finder)); - Input input = target.evaluate().single.widget; + final SetInputText setInputTextCommand = command; + final Finder target = await _waitForElement(_createFinder(setInputTextCommand.finder)); + final Input input = target.evaluate().single.widget; input.onChanged(new InputValue(text: setInputTextCommand.text)); return new SetInputTextResult(); } Future _submitInputText(Command command) async { - SubmitInputText submitInputTextCommand = command; - Finder target = await _waitForElement(_createFinder(submitInputTextCommand.finder)); - Input input = target.evaluate().single.widget; + final SubmitInputText submitInputTextCommand = command; + final Finder target = await _waitForElement(_createFinder(submitInputTextCommand.finder)); + final Input input = target.evaluate().single.widget; input.onSubmitted(input.value); return new SubmitInputTextResult(input.value.text); } Future _getText(Command command) async { - GetText getTextCommand = command; - Finder target = await _waitForElement(_createFinder(getTextCommand.finder)); + final GetText getTextCommand = command; + final Finder target = await _waitForElement(_createFinder(getTextCommand.finder)); // TODO(yjbanov): support more ways to read text - Text text = target.evaluate().single.widget; + final Text text = target.evaluate().single.widget; return new GetTextResult(text.data); } Future _setFrameSync(Command command) async { - SetFrameSync setFrameSyncCommand = command; + final SetFrameSync setFrameSyncCommand = command; _frameSync = setFrameSyncCommand.enabled; return new SetFrameSyncResult(); } diff --git a/packages/flutter_driver/lib/src/find.dart b/packages/flutter_driver/lib/src/find.dart index 1cf502740b..61c8c5c349 100644 --- a/packages/flutter_driver/lib/src/find.dart +++ b/packages/flutter_driver/lib/src/find.dart @@ -92,7 +92,7 @@ abstract class SerializableFinder { /// Deserializes a finder from JSON generated by [serialize]. static SerializableFinder deserialize(Map json) { - String finderType = json['finderType']; + final String finderType = json['finderType']; switch(finderType) { case 'ByValueKey': return ByValueKey.deserialize(json); case 'ByTooltipMessage': return ByTooltipMessage.deserialize(json); @@ -188,8 +188,8 @@ class ByValueKey extends SerializableFinder { /// Deserializes the finder from JSON generated by [serialize]. static ByValueKey deserialize(Map json) { - String keyValueString = json['keyValueString']; - String keyValueType = json['keyValueType']; + final String keyValueString = json['keyValueString']; + final String keyValueType = json['keyValueType']; switch(keyValueType) { case 'int': return new ByValueKey(int.parse(keyValueString)); diff --git a/packages/flutter_driver/lib/src/input.dart b/packages/flutter_driver/lib/src/input.dart index e1a357875f..d4be240eab 100644 --- a/packages/flutter_driver/lib/src/input.dart +++ b/packages/flutter_driver/lib/src/input.dart @@ -26,7 +26,7 @@ class SetInputText extends CommandWithTarget { @override Map serialize() { - Map json = super.serialize(); + final Map json = super.serialize(); json['text'] = text; return json; } diff --git a/packages/flutter_driver/lib/src/matcher_util.dart b/packages/flutter_driver/lib/src/matcher_util.dart index b318f1d7b0..b6d81a8e4f 100644 --- a/packages/flutter_driver/lib/src/matcher_util.dart +++ b/packages/flutter_driver/lib/src/matcher_util.dart @@ -6,11 +6,11 @@ import 'package:matcher/matcher.dart'; /// Matches [value] against the [matcher]. MatchResult match(dynamic value, Matcher matcher) { - Map matchState = {}; + final Map matchState = {}; if (matcher.matches(value, matchState)) { return new MatchResult._matched(); } else { - Description description = + final Description description = matcher.describeMismatch(value, new _TextDescription(), matchState, false); return new MatchResult._mismatched(description.toString()); } diff --git a/packages/flutter_driver/lib/src/retry.dart b/packages/flutter_driver/lib/src/retry.dart index bd0cccc0d9..ff1346fb10 100644 --- a/packages/flutter_driver/lib/src/retry.dart +++ b/packages/flutter_driver/lib/src/retry.dart @@ -23,7 +23,7 @@ Future retry(Action action, Duration timeout, assert(timeout != null); assert(pauseBetweenRetries != null); - Stopwatch sw = stopwatchFactory()..start(); + final Stopwatch sw = stopwatchFactory()..start(); dynamic result; dynamic lastError; dynamic lastStackTrace; diff --git a/packages/flutter_driver/lib/src/timeline.dart b/packages/flutter_driver/lib/src/timeline.dart index bb1d063d3e..dc7ddc5780 100644 --- a/packages/flutter_driver/lib/src/timeline.dart +++ b/packages/flutter_driver/lib/src/timeline.dart @@ -122,7 +122,7 @@ class TimelineEvent { } List _parseEvents(Map json) { - List> jsonEvents = json['traceEvents']; + final List> jsonEvents = json['traceEvents']; if (jsonEvents == null) return null; diff --git a/packages/flutter_driver/lib/src/timeline_summary.dart b/packages/flutter_driver/lib/src/timeline_summary.dart index 5706fe2b83..4a705b015b 100644 --- a/packages/flutter_driver/lib/src/timeline_summary.dart +++ b/packages/flutter_driver/lib/src/timeline_summary.dart @@ -93,7 +93,7 @@ class TimelineSummary { {String destinationDirectory, bool pretty: false}) async { destinationDirectory ??= testOutputsDirectory; await fs.directory(destinationDirectory).create(recursive: true); - File file = fs.file(path.join(destinationDirectory, '$traceName.timeline.json')); + final File file = fs.file(path.join(destinationDirectory, '$traceName.timeline.json')); await file.writeAsString(_encodeJson(_timeline.json, pretty)); } @@ -102,7 +102,7 @@ class TimelineSummary { {String destinationDirectory, bool pretty: false}) async { destinationDirectory ??= testOutputsDirectory; await fs.directory(destinationDirectory).create(recursive: true); - File file = fs.file(path.join(destinationDirectory, '$traceName.timeline_summary.json')); + final File file = fs.file(path.join(destinationDirectory, '$traceName.timeline_summary.json')); await file.writeAsString(_encodeJson(summaryJson, pretty)); } @@ -127,15 +127,15 @@ class TimelineSummary { /// /// See: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU List _extractBeginEndEvents(String name) { - List result = []; + final List result = []; // Timeline does not guarantee that the first event is the "begin" event. - Iterator events = _extractNamedEvents(name) + final Iterator events = _extractNamedEvents(name) .skipWhile((TimelineEvent evt) => evt.phase != 'B').iterator; while(events.moveNext()) { - TimelineEvent beginEvent = events.current; + final TimelineEvent beginEvent = events.current; if (events.moveNext()) { - TimelineEvent endEvent = events.current; + final TimelineEvent endEvent = events.current; result.add(new TimedEvent( beginEvent.timestampMicros, endEvent.timestampMicros @@ -150,7 +150,7 @@ class TimelineSummary { if (durations.isEmpty) return null; - int total = durations.fold(0, (int t, Duration duration) => t + duration.inMilliseconds); + final int total = durations.fold(0, (int t, Duration duration) => t + duration.inMilliseconds); return total / durations.length; } diff --git a/packages/flutter_driver/test/flutter_driver_test.dart b/packages/flutter_driver/test/flutter_driver_test.dart index f447094971..d6a9495cb8 100644 --- a/packages/flutter_driver/test/flutter_driver_test.dart +++ b/packages/flutter_driver/test/flutter_driver_test.dart @@ -53,7 +53,7 @@ void main() { when(mockIsolate.resume()).thenReturn(new Future.value()); when(mockIsolate.onExtensionAdded).thenReturn(new Stream.fromIterable(['ext.flutter.driver'])); - FlutterDriver driver = await FlutterDriver.connect(dartVmServiceUrl: ''); + final FlutterDriver driver = await FlutterDriver.connect(dartVmServiceUrl: ''); expect(driver, isNotNull); expectLogContains('Isolate is paused at start'); }); @@ -62,7 +62,7 @@ void main() { when(mockIsolate.pauseEvent).thenReturn(new MockVMPauseBreakpointEvent()); when(mockIsolate.resume()).thenReturn(new Future.value()); - FlutterDriver driver = await FlutterDriver.connect(dartVmServiceUrl: ''); + final FlutterDriver driver = await FlutterDriver.connect(dartVmServiceUrl: ''); expect(driver, isNotNull); expectLogContains('Isolate is paused mid-flight'); }); @@ -79,14 +79,14 @@ void main() { return new Future.error(new rpc.RpcException(101, '')); }); - FlutterDriver driver = await FlutterDriver.connect(dartVmServiceUrl: ''); + final FlutterDriver driver = await FlutterDriver.connect(dartVmServiceUrl: ''); expect(driver, isNotNull); expectLogContains('Attempted to resume an already resumed isolate'); }); test('connects to unpaused isolate', () async { when(mockIsolate.pauseEvent).thenReturn(new MockVMResumeEvent()); - FlutterDriver driver = await FlutterDriver.connect(dartVmServiceUrl: ''); + final FlutterDriver driver = await FlutterDriver.connect(dartVmServiceUrl: ''); expect(driver, isNotNull); expectLogContains('Isolate is not paused. Assuming application is ready.'); }); @@ -108,7 +108,7 @@ void main() { test('checks the health of the driver extension', () async { when(mockIsolate.invokeExtension(any, any)).thenReturn( makeMockResponse({'status': 'ok'})); - Health result = await driver.checkHealth(); + final Health result = await driver.checkHealth(); expect(result.status, HealthStatus.ok); }); @@ -175,7 +175,7 @@ void main() { 'text': 'hello' }); }); - String result = await driver.getText(find.byValueKey(123)); + final String result = await driver.getText(find.byValueKey(123)); expect(result, 'hello'); }); }); @@ -240,7 +240,7 @@ void main() { }; }); - Timeline timeline = await driver.traceAction(() { + final Timeline timeline = await driver.traceAction(() { actionCalled = true; }); @@ -279,7 +279,7 @@ void main() { }; }); - Timeline timeline = await driver.traceAction(() { + final Timeline timeline = await driver.traceAction(() { actionCalled = true; }, streams: const [ diff --git a/packages/flutter_driver/test/src/matcher_util_test.dart b/packages/flutter_driver/test/src/matcher_util_test.dart index 3e91b23b82..04fb1e2612 100644 --- a/packages/flutter_driver/test/src/matcher_util_test.dart +++ b/packages/flutter_driver/test/src/matcher_util_test.dart @@ -8,8 +8,8 @@ import 'package:flutter_driver/src/matcher_util.dart'; void main() { group('match', () { test('matches', () { - _TestMatcher matcher = new _TestMatcher(1); - MatchResult ok = match(1, matcher); + final _TestMatcher matcher = new _TestMatcher(1); + final MatchResult ok = match(1, matcher); expect(ok.hasMatched, isTrue); expect(ok.mismatchDescription, isNull); expect(matcher.matchState1 is Map, isTrue); @@ -17,8 +17,8 @@ void main() { }); test('mismatches', () { - _TestMatcher matcher = new _TestMatcher(2); - MatchResult fail = match(1, matcher); + final _TestMatcher matcher = new _TestMatcher(2); + final MatchResult fail = match(1, matcher); expect(fail.hasMatched, isFalse); expect(fail.mismatchDescription, 'mismatch!'); expect(matcher.matchState1, matcher.matchState2); diff --git a/packages/flutter_driver/test/src/retry_test.dart b/packages/flutter_driver/test/src/retry_test.dart index 73358dbfad..f92bddfab4 100644 --- a/packages/flutter_driver/test/src/retry_test.dart +++ b/packages/flutter_driver/test/src/retry_test.dart @@ -15,7 +15,7 @@ void main() { setUp(() { fakeAsync = new FakeAsync(); - Clock fakeClock = fakeAsync.getClock(new DateTime.now()); + final Clock fakeClock = fakeAsync.getClock(new DateTime.now()); stopwatchFactory = () { return new FakeStopwatch( () => fakeClock.now().millisecondsSinceEpoch, diff --git a/packages/flutter_driver/test/src/timeline_summary_test.dart b/packages/flutter_driver/test/src/timeline_summary_test.dart index 1701db3ad2..9fea04efb6 100644 --- a/packages/flutter_driver/test/src/timeline_summary_test.dart +++ b/packages/flutter_driver/test/src/timeline_summary_test.dart @@ -84,7 +84,7 @@ void main() { group('computeMissedFrameBuildBudgetCount', () { test('computes the number of missed build budgets', () { - TimelineSummary summary = summarize(>[ + final TimelineSummary summary = summarize(>[ build(1000, 9000), build(11000, 1000), build(13000, 10000), @@ -176,7 +176,7 @@ void main() { group('computeMissedFrameRasterizerBudgetCount', () { test('computes the number of missed rasterizer budgets', () { - TimelineSummary summary = summarize(>[ + final TimelineSummary summary = summarize(>[ begin(1000), end(10000), begin(11000), end(12000), begin(13000), end(23000), @@ -229,7 +229,7 @@ void main() { test('writes timeline to JSON file', () async { await summarize(>[{'foo': 'bar'}]) .writeTimelineToFile('test', destinationDirectory: tempDir.path); - String written = + final String written = await fs.file(path.join(tempDir.path, 'test.timeline.json')).readAsString(); expect(written, '{"traceEvents":[{"foo":"bar"}]}'); }); @@ -243,7 +243,7 @@ void main() { build(11000, 1000), build(13000, 11000), ]).writeSummaryToFile('test', destinationDirectory: tempDir.path); - String written = + final String written = await fs.file(path.join(tempDir.path, 'test.timeline_summary.json')).readAsString(); expect(JSON.decode(written), { 'average_frame_build_time_millis': 7.0, diff --git a/packages/flutter_driver/test/src/timeline_test.dart b/packages/flutter_driver/test/src/timeline_test.dart index 3e7211ea3d..cfcc02e7bf 100644 --- a/packages/flutter_driver/test/src/timeline_test.dart +++ b/packages/flutter_driver/test/src/timeline_test.dart @@ -8,7 +8,7 @@ import 'package:flutter_driver/src/timeline.dart'; void main() { group('Timeline', () { test('parses JSON', () { - Timeline timeline = new Timeline.fromJson({ + final Timeline timeline = new Timeline.fromJson({ 'traceEvents': >[ { 'name': 'test event', @@ -31,7 +31,7 @@ void main() { expect(timeline.events, hasLength(2)); - TimelineEvent e1 = timeline.events[0]; + final TimelineEvent e1 = timeline.events[0]; expect(e1.name, 'test event'); expect(e1.category, 'test category'); expect(e1.phase, 'B'); @@ -43,7 +43,7 @@ void main() { expect(e1.threadTimestampMicros, 567); expect(e1.arguments, { 'arg1': true }); - TimelineEvent e2 = timeline.events[1]; + final TimelineEvent e2 = timeline.events[1]; expect(e2.name, isNull); expect(e2.category, isNull); expect(e2.phase, isNull);