From 59da873ef089c6cd8e559a054b814e69fa02f47e Mon Sep 17 00:00:00 2001 From: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com> Date: Thu, 22 Feb 2024 19:16:20 -0800 Subject: [PATCH] Remove deprecated `KeepAliveHandle.release` (#143961) https://github.com/flutter/flutter/issues/143956 I still did not include a dartfix since a dartfix that replaces `release` with `dispose` would change the semantics and may cause a runtime crash instead of a build error. @Piinks does setting `bulkApply` to false force the user to apply the fix to every occurrence one by one in their IDE? If so then it seems that would be the way to go for this deprecation? --- .../lib/src/widgets/automatic_keep_alive.dart | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/packages/flutter/lib/src/widgets/automatic_keep_alive.dart b/packages/flutter/lib/src/widgets/automatic_keep_alive.dart index bd40d2aa80f..e5573db4a98 100644 --- a/packages/flutter/lib/src/widgets/automatic_keep_alive.dart +++ b/packages/flutter/lib/src/widgets/automatic_keep_alive.dart @@ -319,19 +319,6 @@ class KeepAliveNotification extends Notification { /// consider using [AutomaticKeepAliveClientMixin], which uses a /// [KeepAliveHandle] internally. class KeepAliveHandle extends ChangeNotifier { - /// Trigger the listeners to indicate that the widget - /// no longer needs to be kept alive. - /// - /// This method does not call [dispose]. When the handle is not needed - /// anymore, it must be [dispose]d regardless of whether notifying listeners. - @Deprecated( - 'Use dispose instead. ' - 'This feature was deprecated after v3.3.0-0.0.pre.', - ) - void release() { - notifyListeners(); - } - @override void dispose() { notifyListeners(); @@ -366,7 +353,6 @@ mixin AutomaticKeepAliveClientMixin on State { } void _releaseKeepAlive() { - // Dispose and release do not imply each other. _keepAliveHandle!.dispose(); _keepAliveHandle = null; }