diff --git a/pkgs/leak_tracker/lib/src/leak_tracking/leak_tracker.dart b/pkgs/leak_tracker/lib/src/leak_tracking/leak_tracker.dart index a9b56eb7..9cccd9bc 100644 --- a/pkgs/leak_tracker/lib/src/leak_tracking/leak_tracker.dart +++ b/pkgs/leak_tracker/lib/src/leak_tracking/leak_tracker.dart @@ -36,7 +36,7 @@ void enableLeakTracking({ bool resetIfAlreadyEnabled = false, }) { assert(() { - final theConfig = config ??= LeakTrackingConfiguration(); + final theConfig = config ??= const LeakTrackingConfiguration(); if (_objectTracker.value != null) { if (!resetIfAlreadyEnabled) { throw StateError('Leak tracking is already enabled.'); diff --git a/pkgs/leak_tracker/lib/src/leak_tracking/leak_tracker_model.dart b/pkgs/leak_tracker/lib/src/leak_tracking/leak_tracker_model.dart index 2b94dda6..39069b5f 100644 --- a/pkgs/leak_tracker/lib/src/leak_tracking/leak_tracker_model.dart +++ b/pkgs/leak_tracker/lib/src/leak_tracking/leak_tracker_model.dart @@ -61,7 +61,7 @@ class LeakDiagnosticConfig { } class LeakTrackingConfiguration { - LeakTrackingConfiguration({ + const LeakTrackingConfiguration({ this.stdoutLeaks = true, this.notifyDevTools = true, this.onLeaks, diff --git a/pkgs/leak_tracker/test/release/leak_tracking/_leak_checker_test.dart b/pkgs/leak_tracker/test/release/leak_tracking/_leak_checker_test.dart index ed445de4..215ca92c 100644 --- a/pkgs/leak_tracker/test/release/leak_tracking/_leak_checker_test.dart +++ b/pkgs/leak_tracker/test/release/leak_tracking/_leak_checker_test.dart @@ -17,8 +17,7 @@ class _SummaryValues { LeakType.notGCed: 3, }); - static final nonZeroCopy = - LeakSummary({}..addAll(nonZero.totals)); + static final nonZeroCopy = LeakSummary({}..addAll(nonZero.totals)); } void main() { @@ -71,7 +70,7 @@ void main() { ); // Mock defaults match real configuration defaults. - final config = LeakTrackingConfiguration(); + const config = LeakTrackingConfiguration(); final checker = defaultLeakChecker(); expect(config.notifyDevTools, checker.devToolsSink != null); expect(config.stdoutLeaks, checker.stdoutSink != null);