mirror of
https://github.com/flutter/flutter
synced 2024-07-16 10:29:14 +00:00
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:
parent
10a50bcc7a
commit
59da873ef0
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue