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?
This commit is contained in:
LongCatIsLooong 2024-02-22 19:16:20 -08:00 committed by GitHub
parent 10a50bcc7a
commit 59da873ef0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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<T extends StatefulWidget> on State<T> {
}
void _releaseKeepAlive() {
// Dispose and release do not imply each other.
_keepAliveHandle!.dispose();
_keepAliveHandle = null;
}