diff --git a/packages/devtools_app/lib/src/screens/debugger/codeview.dart b/packages/devtools_app/lib/src/screens/debugger/codeview.dart index 36aa8980844..b5f2a53c067 100644 --- a/packages/devtools_app/lib/src/screens/debugger/codeview.dart +++ b/packages/devtools_app/lib/src/screens/debugger/codeview.dart @@ -863,7 +863,7 @@ class Gutter extends StatelessWidget { @override Widget build(BuildContext context) { - final bpLineSet = Set.from(breakpoints.map((bp) => bp.line)); + final bpLineSet = Set.of(breakpoints.map((bp) => bp.line)); final theme = Theme.of(context); final coverageLines = sourceReport.coverageHitLines.union(sourceReport.coverageMissedLines); diff --git a/packages/devtools_app/lib/src/screens/debugger/file_search.dart b/packages/devtools_app/lib/src/screens/debugger/file_search.dart index 87ee92f0fe9..6a4db82c6c6 100644 --- a/packages/devtools_app/lib/src/screens/debugger/file_search.dart +++ b/packages/devtools_app/lib/src/screens/debugger/file_search.dart @@ -396,7 +396,7 @@ class FileSearchResults { return copyWith(); } - final topMatches = []; + final topMatches = >[]; int matchesLeft = numOfMatchesToShow; for (final matches in [ _exactFileNameMatches, diff --git a/packages/devtools_app/lib/src/screens/memory/shared/heap/heap.dart b/packages/devtools_app/lib/src/screens/memory/shared/heap/heap.dart index b6ef5817f6d..5f30c3948f8 100644 --- a/packages/devtools_app/lib/src/screens/memory/shared/heap/heap.dart +++ b/packages/devtools_app/lib/src/screens/memory/shared/heap/heap.dart @@ -46,7 +46,7 @@ class AdaptedHeap { assert(data.allFieldsCalculated); final result = {}; - for (var i in Iterable.generate(data.objects.length)) { + for (var i in Iterable.generate(data.objects.length)) { if (_uiReleaser.step()) await _uiReleaser.releaseUi(); final object = data.objects[i]; final className = object.heapClass; diff --git a/packages/devtools_app/lib/src/screens/memory/shared/heap/model.dart b/packages/devtools_app/lib/src/screens/memory/shared/heap/model.dart index dc92b9e633c..2fcffed733b 100644 --- a/packages/devtools_app/lib/src/screens/memory/shared/heap/model.dart +++ b/packages/devtools_app/lib/src/screens/memory/shared/heap/model.dart @@ -91,7 +91,7 @@ class ClassOnlyHeapPath { return data.join().trim(); } - late final _listEquality = const ListEquality().equals; + late final _listEquality = const ListEquality().equals; @override bool operator ==(Object other) { diff --git a/packages/devtools_app/lib/src/screens/memory/shared/heap/spanning_tree.dart b/packages/devtools_app/lib/src/screens/memory/shared/heap/spanning_tree.dart index 22f41d1f202..c5649580784 100644 --- a/packages/devtools_app/lib/src/screens/memory/shared/heap/spanning_tree.dart +++ b/packages/devtools_app/lib/src/screens/memory/shared/heap/spanning_tree.dart @@ -25,7 +25,7 @@ Future calculateHeap(AdaptedHeapData heap) async { Future _setInboundRefs(AdaptedHeapData heap) async { int totalDartSize = 0; - for (final from in Iterable.generate(heap.objects.length)) { + for (final from in Iterable.generate(heap.objects.length)) { totalDartSize += heap.objects[from].shallowSize; if (_uiReleaser.step()) await _uiReleaser.releaseUi(); for (final to in heap.objects[from].outRefs) { diff --git a/packages/devtools_app/lib/src/screens/performance/panes/frame_analysis/frame_hints.dart b/packages/devtools_app/lib/src/screens/performance/panes/frame_analysis/frame_hints.dart index a8e0e8cdca3..b9f1266d1c9 100644 --- a/packages/devtools_app/lib/src/screens/performance/panes/frame_analysis/frame_hints.dart +++ b/packages/devtools_app/lib/src/screens/performance/panes/frame_analysis/frame_hints.dart @@ -59,7 +59,7 @@ class FrameHints extends StatelessWidget { if (intrinsicOperationsCount > 0) IntrinsicOperationsHint(intrinsicOperationsCount), ] - : []; + : []; final rasterHints = showRasterJankHints ? [ const Text('Raster Jank Detected'), @@ -71,7 +71,7 @@ class FrameHints extends StatelessWidget { const SizedBox(height: denseSpacing), const RasterStatsHint(), ] - : []; + : []; return Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/packages/devtools_app/lib/src/shared/diagnostics/inspector_service.dart b/packages/devtools_app/lib/src/shared/diagnostics/inspector_service.dart index 754fed8b597..c92f525937d 100644 --- a/packages/devtools_app/lib/src/shared/diagnostics/inspector_service.dart +++ b/packages/devtools_app/lib/src/shared/diagnostics/inspector_service.dart @@ -548,7 +548,7 @@ abstract class InspectorObjectGroupBase WidgetInspectorServiceExtensions.disposeGroup.name, groupName, ) - : Future.value(); + : Future.value(); disposed = true; return disposeComplete; } diff --git a/packages/devtools_app/lib/src/shared/memory/adapted_heap_data.dart b/packages/devtools_app/lib/src/shared/memory/adapted_heap_data.dart index 39280e7db40..a9a25ab3594 100644 --- a/packages/devtools_app/lib/src/shared/memory/adapted_heap_data.dart +++ b/packages/devtools_app/lib/src/shared/memory/adapted_heap_data.dart @@ -62,7 +62,7 @@ class AdaptedHeapData { HeapSnapshotGraph graph, ) async { final objects = []; - for (final i in Iterable.generate(graph.objects.length)) { + for (final i in Iterable.generate(graph.objects.length)) { if (_uiReleaser.step()) await _uiReleaser.releaseUi(); final object = AdaptedHeapObject.fromHeapSnapshotObject(graph.objects[i], i); @@ -93,9 +93,9 @@ class AdaptedHeapData { String snapshotName = ''; - /// Heap objects by identityHashCode. - late final _objectsByCode = { - for (var i in Iterable.generate(objects.length)) objects[i].code: i, + /// Heap objects by `identityHashCode`. + late final _objectsByCode = { + for (var i in Iterable.generate(objects.length)) objects[i].code: i, }; int? objectIndexByIdentityHashCode(IdentityHashCode code) => diff --git a/packages/devtools_app/lib/src/shared/ui/hover.dart b/packages/devtools_app/lib/src/shared/ui/hover.dart index 92e40d9dc56..b05b1feb296 100644 --- a/packages/devtools_app/lib/src/shared/ui/hover.dart +++ b/packages/devtools_app/lib/src/shared/ui/hover.dart @@ -506,7 +506,7 @@ class _HoverCardTooltipState extends State { } Completer _timeoutCompleter(int timeout) { - final completer = Completer(); + final completer = Completer(); Timer(Duration(milliseconds: timeout), () { completer.complete(); }); diff --git a/packages/devtools_app/lib/src/standalone_ui/api/impl/dart_tooling_api.dart b/packages/devtools_app/lib/src/standalone_ui/api/impl/dart_tooling_api.dart index 65125ece387..cc356b57bbf 100644 --- a/packages/devtools_app/lib/src/standalone_ui/api/impl/dart_tooling_api.dart +++ b/packages/devtools_app/lib/src/standalone_ui/api/impl/dart_tooling_api.dart @@ -45,7 +45,7 @@ class DartToolingApiImpl implements DartToolingApi { if (_enablePostMessageVerboseLogging) { setDevToolsLoggingLevel(verboseLoggingLevel); } - final postMessageController = StreamController(); + final postMessageController = StreamController(); postMessageController.stream.listen((message) { // TODO(dantup): Using fine here doesn't work even though the // `setDevToolsLoggingLevel` call above seems like it should show finest diff --git a/packages/devtools_app/test/debugger/debugger_controller_test.dart b/packages/devtools_app/test/debugger/debugger_controller_test.dart index 4ee750aab28..8e15d0cdf96 100644 --- a/packages/devtools_app/test/debugger/debugger_controller_test.dart +++ b/packages/devtools_app/test/debugger/debugger_controller_test.dart @@ -124,7 +124,7 @@ void main() { }); test('starts empty', () { - expect(evalHistory.evalHistory, []); + expect(evalHistory.evalHistory, []); expect(evalHistory.currentText, null); expect(evalHistory.canNavigateDown, false); expect(evalHistory.canNavigateUp, false); diff --git a/packages/devtools_app/test/legacy_integration_tests/integration.dart b/packages/devtools_app/test/legacy_integration_tests/integration.dart index bcbddc58195..30b45b85439 100644 --- a/packages/devtools_app/test/legacy_integration_tests/integration.dart +++ b/packages/devtools_app/test/legacy_integration_tests/integration.dart @@ -40,7 +40,7 @@ class DevtoolsManager { waitForConnection ? tabInstance.onEvent .firstWhere((msg) => msg.event == 'app.devToolsReady') - : Future.value(), + : Future.value(), tabInstance.getBrowserChannel(), ]); } diff --git a/packages/devtools_app/test/network/network_model_test.dart b/packages/devtools_app/test/network/network_model_test.dart index 0217aa192fb..63cc38f6db0 100644 --- a/packages/devtools_app/test/network/network_model_test.dart +++ b/packages/devtools_app/test/network/network_model_test.dart @@ -246,7 +246,7 @@ void main() { 'isRedirect': false, 'persistentConnection': true, 'reasonPhrase': 'OK', - 'redirects': [], + 'redirects': [], 'statusCode': 200, }), isTrue, @@ -273,7 +273,7 @@ void main() { 'isRedirect': false, 'persistentConnection': true, 'reasonPhrase': 'Created', - 'redirects': [], + 'redirects': [], 'statusCode': 201, }), isTrue, @@ -293,7 +293,7 @@ void main() { 'isRedirect': false, 'persistentConnection': true, 'reasonPhrase': 'OK', - 'redirects': [], + 'redirects': [], 'statusCode': 200, }), isTrue, @@ -312,7 +312,7 @@ void main() { 'isRedirect': false, 'persistentConnection': true, 'reasonPhrase': 'OK', - 'redirects': [], + 'redirects': [], 'statusCode': 200, }), isTrue, @@ -332,7 +332,7 @@ void main() { 'isRedirect': false, 'persistentConnection': true, 'reasonPhrase': 'Switching Protocols', - 'redirects': [], + 'redirects': [], 'statusCode': 101, }), isTrue, @@ -358,19 +358,19 @@ void main() { expect(httpGetWithError.requestHeaders, isNull); expect( collectionEquals(httpPost.requestHeaders, { - 'transfer-encoding': [], + 'transfer-encoding': [], }), isTrue, ); expect( collectionEquals(httpPut.requestHeaders, { - 'transfer-encoding': [], + 'transfer-encoding': [], }), isTrue, ); expect( collectionEquals(httpPatch.requestHeaders, { - 'transfer-encoding': [], + 'transfer-encoding': [], }), isTrue, ); diff --git a/packages/devtools_app/test/performance/performance_model_test.dart b/packages/devtools_app/test/performance/performance_model_test.dart index 8fdf5af5268..dc6c9245021 100644 --- a/packages/devtools_app/test/performance/performance_model_test.dart +++ b/packages/devtools_app/test/performance/performance_model_test.dart @@ -47,12 +47,12 @@ void main() { performanceData.toJson(), equals({ PerformanceData.selectedFrameIdKey: null, - PerformanceData.flutterFramesKey: [], + PerformanceData.flutterFramesKey: [], PerformanceData.displayRefreshRateKey: 60, - PerformanceData.traceEventsKey: [], - PerformanceData.selectedEventKey: {}, - PerformanceData.cpuProfileKey: {}, - PerformanceData.rasterStatsKey: {}, + PerformanceData.traceEventsKey: [], + PerformanceData.selectedEventKey: {}, + PerformanceData.cpuProfileKey: {}, + PerformanceData.rasterStatsKey: {}, PerformanceData.rebuildCountModelKey: null, }), ); diff --git a/packages/devtools_app/test/performance/timeline_events/legacy/legacy_event_processor_test.dart b/packages/devtools_app/test/performance/timeline_events/legacy/legacy_event_processor_test.dart index 838572e980b..b4c3f03872e 100644 --- a/packages/devtools_app/test/performance/timeline_events/legacy/legacy_event_processor_test.dart +++ b/packages/devtools_app/test/performance/timeline_events/legacy/legacy_event_processor_test.dart @@ -135,7 +135,7 @@ void main() { 'pid': 94955, 'ts': 118039650802, 'ph': 'B', - 'args': {}, + 'args': {}, }); final animatorBeginFrameEvent = testTraceEventWrapper({ 'name': 'Animator::BeginFrame', @@ -144,7 +144,7 @@ void main() { 'pid': 94955, 'ts': 118039650802, 'ph': 'B', - 'args': {}, + 'args': {}, }); traceEvents = [ vsyncEvent, diff --git a/packages/devtools_app/test/performance/timeline_events/perfetto/perfetto_event_processor_test.dart b/packages/devtools_app/test/performance/timeline_events/perfetto/perfetto_event_processor_test.dart index 833c21af68a..29186a340fd 100644 --- a/packages/devtools_app/test/performance/timeline_events/perfetto/perfetto_event_processor_test.dart +++ b/packages/devtools_app/test/performance/timeline_events/perfetto/perfetto_event_processor_test.dart @@ -158,7 +158,7 @@ final _frameIdentifierEvents = [ 'pid': 94955, 'ts': 200, 'ph': 'E', - 'args': {}, + 'args': {}, }), testTraceEventWrapper({ 'name': 'Animator::BeginFrame', @@ -176,7 +176,7 @@ final _frameIdentifierEvents = [ 'pid': 94955, 'ts': 400, 'ph': 'E', - 'args': {}, + 'args': {}, }), testTraceEventWrapper({ 'name': 'Animator::BeginFrame', @@ -194,7 +194,7 @@ final _frameIdentifierEvents = [ 'pid': 94955, 'ts': 600, 'ph': 'E', - 'args': {}, + 'args': {}, }), testTraceEventWrapper({ 'name': 'GPURasterizer::Draw', @@ -215,7 +215,7 @@ final _frameIdentifierEvents = [ 'pid': 94955, 'ts': 250, 'ph': 'E', - 'args': {}, + 'args': {}, }), testTraceEventWrapper({ 'name': 'GPURasterizer::Draw', @@ -236,7 +236,7 @@ final _frameIdentifierEvents = [ 'pid': 94955, 'ts': 450, 'ph': 'E', - 'args': {}, + 'args': {}, }), testTraceEventWrapper({ 'name': 'GPURasterizer::Draw', @@ -257,6 +257,6 @@ final _frameIdentifierEvents = [ 'pid': 94955, 'ts': 650, 'ph': 'E', - 'args': {}, + 'args': {}, }), ]; diff --git a/packages/devtools_app/test/primitives/utils_test.dart b/packages/devtools_app/test/primitives/utils_test.dart index eb8f40a0bc0..6e84319425e 100644 --- a/packages/devtools_app/test/primitives/utils_test.dart +++ b/packages/devtools_app/test/primitives/utils_test.dart @@ -1386,7 +1386,10 @@ void main() { subtractor: elementSubtractor, ); - expect(const SetEquality().equals(result.keys.toSet(), {1, 2}), true); + expect( + const SetEquality().equals(result.keys.toSet(), {1, 2}), + true, + ); expect( result[1], equals(_SubtractionResult(subtract: 'subtract', from: 1.0)), @@ -1411,7 +1414,7 @@ void main() { subtractor: elementSubtractor, ); - expect(const SetEquality().equals(result.keys.toSet(), {1}), true); + expect(const SetEquality().equals(result.keys.toSet(), {1}), true); expect( result[1], equals(_SubtractionResult(subtract: null, from: 1.0)), @@ -1432,7 +1435,7 @@ void main() { subtractor: elementSubtractor, ); - expect(const SetEquality().equals(result.keys.toSet(), {1}), true); + expect(const SetEquality().equals(result.keys.toSet(), {1}), true); expect( result[1], equals(_SubtractionResult(subtract: 'subtract', from: null)), @@ -1443,7 +1446,7 @@ void main() { group('joinWithTrailing', () { test('joins no items', () { - expect([].joinWithTrailing(':'), equals('')); + expect([].joinWithTrailing(':'), equals('')); }); test(' joins 1 item', () { expect(['A'].joinWithTrailing(':'), equals('A:')); diff --git a/packages/devtools_app/test/test_infra/fixtures/memory_app/lib/main.dart b/packages/devtools_app/test/test_infra/fixtures/memory_app/lib/main.dart index 44adde93c5a..efaaccde524 100644 --- a/packages/devtools_app/test/test_infra/fixtures/memory_app/lib/main.dart +++ b/packages/devtools_app/test/test_infra/fixtures/memory_app/lib/main.dart @@ -105,7 +105,7 @@ class _MyGarbage { }; map = { - for (var _ in Iterable.generate(_width)) + for (var _ in Iterable.generate(_width)) createInstance(): createInstance(), }; diff --git a/packages/devtools_app/test/test_infra/flutter_test_environment.dart b/packages/devtools_app/test/test_infra/flutter_test_environment.dart index ccdb9f03ae3..a9a66f2566c 100644 --- a/packages/devtools_app/test/test_infra/flutter_test_environment.dart +++ b/packages/devtools_app/test/test_infra/flutter_test_environment.dart @@ -150,7 +150,7 @@ class FlutterTestEnvironment { await serviceConnection.serviceManager.vmServiceOpened( _service, - onClosed: Completer().future, + onClosed: Completer().future, ); await _preferencesController!.init(); diff --git a/packages/devtools_app/test/test_infra/scenes/memory/default.dart b/packages/devtools_app/test/test_infra/scenes/memory/default.dart index df0e605ea1d..c678ca21b2e 100644 --- a/packages/devtools_app/test/test_infra/scenes/memory/default.dart +++ b/packages/devtools_app/test/test_infra/scenes/memory/default.dart @@ -142,7 +142,7 @@ AdaptedHeapData _createHeap(Map classToInstanceCount) { // Create objects. for (var entry in classToInstanceCount.entries) { - for (var _ in Iterable.generate(entry.value)) { + for (var _ in Iterable.generate(entry.value)) { objects.add(_createObject(entry.key)); leafCount++; final objectIndex = leafCount; diff --git a/packages/devtools_app/test/test_infra/scenes/standalone_ui/vs_code_mock_editor.dart b/packages/devtools_app/test/test_infra/scenes/standalone_ui/vs_code_mock_editor.dart index b8b22b78a88..801652dbeec 100644 --- a/packages/devtools_app/test/test_infra/scenes/standalone_ui/vs_code_mock_editor.dart +++ b/packages/devtools_app/test/test_infra/scenes/standalone_ui/vs_code_mock_editor.dart @@ -41,7 +41,7 @@ class _VsCodeFlutterPanelMockEditorState /// The last [maxLogEvents] communication messages sent between the panel /// and the "host IDE". - final logRing = DoubleLinkedQueue(); + final logRing = DoubleLinkedQueue(); /// A stream that emits each time the log is updated to allow the log widget /// to be rebuilt. diff --git a/packages/devtools_app_shared/test/utils/auto_dispose_mixin_test.dart b/packages/devtools_app_shared/test/utils/auto_dispose_mixin_test.dart index 91fb6c8202c..87978fa3de2 100644 --- a/packages/devtools_app_shared/test/utils/auto_dispose_mixin_test.dart +++ b/packages/devtools_app_shared/test/utils/auto_dispose_mixin_test.dart @@ -45,17 +45,17 @@ void main() { group('Disposer', () { test('disposes streams', () { final disposer = Disposer(); - final controller1 = StreamController(sync: true); - final controller2 = StreamController(sync: true); + final controller1 = StreamController(sync: true); + final controller2 = StreamController(sync: true); var c1Events = 0; var c2Events = 0; disposer.autoDisposeStreamSubscription( - controller1.stream.listen((data) { + controller1.stream.listen((_) { c1Events++; }), ); disposer.autoDisposeStreamSubscription( - controller2.stream.listen((data) { + controller2.stream.listen((_) { c2Events++; }), ); @@ -324,7 +324,7 @@ void main() { testWidgets('Test stream auto dispose', (WidgetTester tester) async { // Build our app and trigger a frame. final key = GlobalKey(); - final controller = StreamController(); + final controller = StreamController(); await tester.pumpWidget(AutoDisposedWidget(controller.stream, key: key)); final state = key.currentState as _AutoDisposedWidgetState; diff --git a/packages/devtools_shared/lib/src/service/service.dart b/packages/devtools_shared/lib/src/service/service.dart index 2bea88ce046..eb2a10dbff7 100644 --- a/packages/devtools_shared/lib/src/service/service.dart +++ b/packages/devtools_shared/lib/src/service/service.dart @@ -41,7 +41,7 @@ Future _connectWithSse({ ); serviceCompleter.complete(service); - unawaited(stream.drain().catchError(onError)); + unawaited(stream.drain().catchError(onError)); return serviceCompleter.future; } diff --git a/packages/devtools_test/lib/src/mocks/fake_vm_service_wrapper.dart b/packages/devtools_test/lib/src/mocks/fake_vm_service_wrapper.dart index dc2e83b48e1..126daf21b26 100644 --- a/packages/devtools_test/lib/src/mocks/fake_vm_service_wrapper.dart +++ b/packages/devtools_test/lib/src/mocks/fake_vm_service_wrapper.dart @@ -51,8 +51,8 @@ class FakeVmServiceWrapper extends Fake implements VmServiceWrapper { 'timeOriginMicros': 47377796685, 'timeExtentMicros': 3000, 'pid': 54321, - 'functions': [], - 'samples': [], + 'functions': [], + 'samples': [], })!; CpuSamples cpuSamples;