Skip to content

Commit

Permalink
Clean up some lint violations (#8033)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenzieschmoll authored Jul 8, 2024
1 parent 9e3310a commit 3816e84
Show file tree
Hide file tree
Showing 27 changed files with 181 additions and 175 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ void main() {
timeout: const Timeout(Duration(minutes: 10)),
);
}

// TODO(kenz): add tests that verify performance meets some expected threshold
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ class _ChartControlPaneState extends State<ChartControlPane>
pauseTooltip: ChartPaneTooltips.pauseTooltip,
resumeTooltip: ChartPaneTooltips.resumeTooltip,
gaScreen: gac.memory,
gaSelectionPause: gac.MemoryEvent.pauseChart,
gaSelectionResume: gac.MemoryEvent.resumeChart,
gaSelectionPause: gac.MemoryEvents.pauseChart.name,
gaSelectionResume: gac.MemoryEvents.resumeChart.name,
);
},
),
Expand All @@ -78,7 +78,7 @@ class _ChartControlPaneState extends State<ChartControlPane>
onPressed: _clearTimeline,
tooltip: 'Clear memory chart.',
gaScreen: gac.memory,
gaSelection: gac.MemoryEvent.clearChart,
gaSelection: gac.MemoryEvents.clearChart.name,
iconOnly: true,
),
],
Expand Down Expand Up @@ -112,8 +112,8 @@ class _LegendButton extends StatelessWidget {
onPressed: chartController.data.toggleLegendVisibility,
gaScreen: gac.memory,
gaSelection: legendVisible
? gac.MemoryEvent.hideChartLegend
: gac.MemoryEvent.showChartLegend,
? gac.MemoryEvents.hideChartLegend.name
: gac.MemoryEvents.showChartLegend.name,
icon: legendVisible ? Icons.close : Icons.storage,
label: 'Legend',
tooltip: 'Toggle visibility of the chart legend',
Expand All @@ -126,7 +126,7 @@ class _LegendButton extends StatelessWidget {
class _ChartHelpLink extends StatelessWidget {
const _ChartHelpLink();

static const _documentationTopic = gac.MemoryEvent.chartHelp;
static final _documentationTopic = gac.MemoryEvents.chartHelp.name;

@override
Widget build(BuildContext context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class _IntervalDropdownState extends State<IntervalDropdown> {
setState(() {
ga.select(
gac.memory,
'${gac.MemoryEvent.chartInterval}-${value.displayName}',
'${gac.MemoryEvents.chartInterval.name}-${value.displayName}',
);
widget.chartController.data.displayInterval = value;
final duration = value.duration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SecondaryControls extends StatelessWidget {
tooltip: 'Trigger full garbage collection.',
minScreenWidthForTextBeforeScaling: memoryControlsMinVerboseWidth,
gaScreen: gac.memory,
gaSelection: gac.MemoryEvent.gc,
gaSelection: gac.MemoryEvents.gc.name,
),
const SizedBox(width: denseSpacing),
],
Expand All @@ -51,7 +51,7 @@ class SecondaryControls extends StatelessWidget {
if (controller.mode != ControllerCreationMode.disconnected)
SettingsOutlinedButton(
gaScreen: gac.memory,
gaSelection: gac.MemoryEvent.settings,
gaSelection: gac.MemoryEvents.settings.name,
onPressed: () => _openSettingsDialog(context),
tooltip: 'Open memory settings',
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class DiffPaneController extends DisposableController with Serializable {
Future<void> takeSnapshot() async {
ga.select(
gac.memory,
gac.MemoryEvent.diffTakeSnapshotControlPane,
gac.MemoryEvents.diffTakeSnapshotControlPane.name,
);
final item = SnapshotDataItem(
displayNumber: _nextDisplayNumber(),
Expand Down Expand Up @@ -485,7 +485,7 @@ class DerivedData extends DisposableController with AutoDisposeControllerMixin {

ga.timeStart(
gac.memory,
gac.MemoryTime.updateValues,
gac.MemoryTime.updateValues.name,
);

_updatingValues = true;
Expand All @@ -496,7 +496,7 @@ class DerivedData extends DisposableController with AutoDisposeControllerMixin {

ga.timeEnd(
gac.memory,
gac.MemoryTime.updateValues,
gac.MemoryTime.updateValues.name,
);

_assertIntegrity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ HeapDiffData _calculateDiffGaWrapper(_HeapCouple couple) {
late final HeapDiffData result;
ga.timeSync(
gac.memory,
gac.MemoryTime.calculateDiff,
gac.MemoryTime.calculateDiff.name,
syncOperation: () => result =
calculateHeapDiffData(before: couple.before, after: couple.after),
screenMetricsProvider: () => MemoryScreenMetrics(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class _SnapshotItemContent extends StatelessWidget {

final DiffPaneController controller;

static const _documentationTopic = gac.MemoryEvent.diffHelp;
static final _documentationTopic = gac.MemoryEvents.diffHelp.name;

@override
Widget build(BuildContext context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class _PathControlPane extends StatelessWidget {
// while message is here.
successMessage: null,
gaScreen: gac.memory,
gaItem: gac.MemoryEvent.diffPathCopy,
gaItem: gac.MemoryEvents.diffPathCopy.name,
),
const SizedBox(width: denseSpacing),
ValueListenableBuilder<bool>(
Expand All @@ -91,7 +91,7 @@ class _PathControlPane extends StatelessWidget {
onPressed: () {
ga.select(
gac.memory,
'${gac.MemoryEvent.diffPathFilter}-$hideStandard',
'${gac.MemoryEvents.diffPathFilter.name}-$hideStandard',
);
controller.hideStandard.value = !controller.hideStandard.value;
},
Expand All @@ -106,7 +106,7 @@ class _PathControlPane extends StatelessWidget {
onPressed: () {
ga.select(
gac.memory,
'${gac.MemoryEvent.diffPathInvert}-$invert',
'${gac.MemoryEvents.diffPathInvert.name}-$invert',
);
controller.invert.value = !controller.invert.value;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class RetainingPathTable extends StatelessWidget {
selectionNotifier: selection,
onItemSelected: (_) => ga.select(
gac.memory,
'${gac.MemoryEvent.diffPathSelect}-${isDiff ? "diff" : "single"}',
'${gac.MemoryEvents.diffPathSelect.name}-${isDiff ? "diff" : "single"}',
),
defaultSortColumn: columns.retainedSizeColumn,
defaultSortDirection: SortDirection.descending,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class _ClassNameColumn extends ColumnData<DiffClassData>
return HeapClassView(
theClass: data.className,
showCopyButton: isRowSelected,
copyGaItem: gac.MemoryEvent.diffClassDiffCopy,
copyGaItem: gac.MemoryEvents.diffClassDiffCopy.name,
rootPackage: serviceConnection.serviceManager.rootInfoNow().package,
);
}
Expand Down Expand Up @@ -349,7 +349,7 @@ class ClassesTableDiff extends StatelessWidget {
selectionNotifier: diffData.selection,
onItemSelected: (_) => ga.select(
gac.memory,
gac.MemoryEvent.diffClassDiffSelect,
gac.MemoryEvents.diffClassDiffSelect.name,
),
defaultSortColumn: columns.sizeDeltaColumn,
defaultSortDirection: SortDirection.descending,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class _ClassNameColumn extends ColumnData<SingleClassData>
return HeapClassView(
theClass: data.className,
showCopyButton: isRowSelected,
copyGaItem: gac.MemoryEvent.diffClassSingleCopy,
copyGaItem: gac.MemoryEvents.diffClassSingleCopy.name,
rootPackage: serviceConnection.serviceManager.rootInfoNow().package,
);
}
Expand Down Expand Up @@ -203,7 +203,7 @@ class ClassesTableSingle extends StatelessWidget {
selectionNotifier: classesData.selection,
onItemSelected: (_) => ga.select(
gac.memory,
gac.MemoryEvent.diffClassSingleSelect,
gac.MemoryEvents.diffClassSingleSelect.name,
),
defaultSortColumn: _columns.retainedSizeColumn,
defaultSortDirection: SortDirection.descending,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SnapshotControlPane extends StatelessWidget {
minScreenWidthForTextBeforeScaling:
memoryControlsMinVerboseWidth,
gaScreen: gac.memory,
gaSelection: gac.MemoryEvent.diffSnapshotDownloadCsv,
gaSelection: gac.MemoryEvents.diffSnapshotDownloadCsv.name,
onPressed: controller.downloadCurrentItemToCsv,
),
],
Expand Down Expand Up @@ -103,13 +103,13 @@ class _DiffDropdown extends StatelessWidget {
if ((value ?? current) == current) {
ga.select(
gac.memory,
gac.MemoryEvent.diffSnapshotDiffOff,
gac.MemoryEvents.diffSnapshotDiffSelectOff.name,
);
newDiffWith = null;
} else {
ga.select(
gac.memory,
gac.MemoryEvent.diffSnapshotDiffSelect,
gac.MemoryEvents.diffSnapshotDiffSelect.name,
);
newDiffWith = value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class _ListControlPane extends StatelessWidget {
? () {
ga.select(
gac.memory,
gac.MemoryEvent.diffClearSnapshots,
gac.MemoryEvents.diffClearSnapshots.name,
);
controller.clearSnapshots();
}
Expand Down Expand Up @@ -419,14 +419,14 @@ class _SnapshotListItemsState extends State<_SnapshotListItems>
}
ga.select(
gac.memory,
gac.MemoryEvent.diffSnapshotDelete,
gac.MemoryEvents.diffSnapshotDelete.name,
);
widget.controller.deleteCurrentSnapshot();
},
onExport: () {
ga.select(
gac.memory,
gac.MemoryEvent.diffSnapshotExport,
gac.MemoryEvents.diffSnapshotExport.name,
);
widget.controller.exportCurrentItem();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class _FieldClassNameColumn extends ColumnData<ProfileRecord>
return HeapClassView(
theClass: data.heapClass,
showCopyButton: isRowSelected,
copyGaItem: gac.MemoryEvent.diffClassSingleCopy,
copyGaItem: gac.MemoryEvents.diffClassSingleCopy.name,
rootPackage: serviceConnection.serviceManager.rootInfoNow().package,
);
}
Expand Down Expand Up @@ -624,7 +624,7 @@ class _AllocationProfileTableControls extends StatelessWidget {
const SizedBox(width: denseSpacing),
RefreshButton(
gaScreen: gac.memory,
gaSelection: gac.MemoryEvent.profileRefreshManual,
gaSelection: gac.MemoryEvents.profileRefreshManual.name,
onPressed: controller.refresh,
),
const SizedBox(width: denseSpacing),
Expand Down Expand Up @@ -653,7 +653,7 @@ class _ExportAllocationProfileButton extends StatelessWidget {
builder: (context, currentAllocationProfile, _) {
return DownloadButton(
gaScreen: gac.memory,
gaSelection: gac.MemoryEvent.profileDownloadCsv,
gaSelection: gac.MemoryEvents.profileDownloadCsv.name,
minScreenWidthForTextBeforeScaling: memoryControlsMinVerboseWidth,
tooltip: 'Download allocation profile data in CSV format',
label: 'CSV',
Expand Down Expand Up @@ -688,7 +688,7 @@ class _RefreshOnGCToggleButton extends StatelessWidget {
allocationProfileController.toggleRefreshOnGc();
ga.select(
gac.memory,
'${gac.MemoryEvent.profileRefreshOnGc}-$refreshOnGc',
'${gac.MemoryEvents.profileRefreshOnGc.name}-$refreshOnGc',
);
},
);
Expand All @@ -700,20 +700,19 @@ class _RefreshOnGCToggleButton extends StatelessWidget {
class _ProfileHelpLink extends StatelessWidget {
const _ProfileHelpLink();

static const _documentationTopic = gac.MemoryEvent.profileHelp;

@override
Widget build(BuildContext context) {
return HelpButtonWithDialog(
gaScreen: gac.memory,
gaSelection: gac.topicDocumentationButton(_documentationTopic),
gaSelection:
gac.topicDocumentationButton(gac.MemoryEvents.profileHelp.name),
dialogTitle: 'Memory Allocation Profile Help',
actions: [
MoreInfoLink(
url: DocLinks.profile.value,
gaScreenName: '',
gaSelectedItemDescription:
gac.topicDocumentationLink(_documentationTopic),
gac.topicDocumentationLink(gac.MemoryEvents.profileHelp.name),
),
],
child: const Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class _TraceCheckBoxColumn extends ColumnData<TracedClass>
onChanged: (value) async {
ga.select(
gac.memory,
'${gac.MemoryEvent.tracingTraceCheck}-$value',
'${gac.MemoryEvents.tracingTraceCheck.name}-$value',
);
await controller.setAllocationTracingForClass(item.clazz, value!);
},
Expand Down Expand Up @@ -94,7 +94,7 @@ class _ClassNameColumn extends ColumnData<TracedClass>
return HeapClassView(
theClass: data.name,
showCopyButton: isRowSelected,
copyGaItem: gac.MemoryEvent.diffClassSingleCopy,
copyGaItem: gac.MemoryEvents.diffClassSingleCopy.name,
rootPackage: rootPackage,
);
}
Expand Down Expand Up @@ -157,7 +157,7 @@ class _AllocationTracingTableState extends State<AllocationTracingTable> {
if (now.difference(_editFilterGaSent) < _editFilterGaThrottling) return;
ga.select(
gac.memory,
gac.MemoryEvent.tracingClassFilter,
gac.MemoryEvents.tracingClassFilter.name,
);
_editFilterGaSent = now;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class _TracingTreeHeader extends StatelessWidget {
const SizedBox(width: denseSpacing),
ExpandAllButton(
gaScreen: gac.memory,
gaSelection: gac.MemoryEvent.tracingTreeExpandAll,
gaSelection: gac.MemoryEvents.tracingTreeExpandAll.name,
onPressed: () => updateTreeStateCallback(
() {
for (final root in _currentDataRoots) {
Expand All @@ -215,7 +215,7 @@ class _TracingTreeHeader extends StatelessWidget {
const SizedBox(width: denseSpacing),
CollapseAllButton(
gaScreen: gac.memory,
gaSelection: gac.MemoryEvent.tracingTreeCollapseAll,
gaSelection: gac.MemoryEvents.tracingTreeCollapseAll.name,
onPressed: () => updateTreeStateCallback(
() {
for (final root in _currentDataRoots) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ class _TracingControls extends StatelessWidget {
RefreshButton(
tooltip: 'Request the set of updated allocation traces',
gaScreen: gac.memory,
gaSelection: gac.MemoryEvent.tracingRefresh,
gaSelection: gac.MemoryEvents.tracingRefresh.name,
onPressed: isProfileMode ? null : controller.refresh,
),
const SizedBox(width: denseSpacing),
ClearButton(
tooltip: 'Clear the set of previously collected traces',
gaScreen: gac.memory,
gaSelection: gac.MemoryEvent.tracingClear,
gaSelection: gac.MemoryEvents.tracingClear.name,
onPressed: isProfileMode ? null : controller.clear,
),
const SizedBox(width: denseSpacing),
Expand All @@ -124,7 +124,7 @@ class _TracingControls extends StatelessWidget {
class _ProfileHelpLink extends StatelessWidget {
const _ProfileHelpLink();

static const _documentationTopic = gac.MemoryEvent.tracingHelp;
static final _documentationTopic = gac.MemoryEvents.tracingHelp.name;

@override
Widget build(BuildContext context) {
Expand Down
Loading

0 comments on commit 3816e84

Please sign in to comment.