From e30f9c4218b2f1884f79942983f12bbfe890dfad Mon Sep 17 00:00:00 2001 From: Polina Cherkasova Date: Tue, 5 Sep 2023 14:03:53 -0700 Subject: [PATCH] Revert "_SearchBarState should dispose FocusNode, if it created it." (#134072) Reverts flutter/flutter#133947 as it causes build failures. --- packages/flutter/lib/src/material/search_anchor.dart | 3 --- packages/flutter/test/material/search_anchor_test.dart | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/flutter/lib/src/material/search_anchor.dart b/packages/flutter/lib/src/material/search_anchor.dart index 4897de7449d..6cb8c22c1c6 100644 --- a/packages/flutter/lib/src/material/search_anchor.dart +++ b/packages/flutter/lib/src/material/search_anchor.dart @@ -1179,9 +1179,6 @@ class _SearchBarState extends State { @override void dispose() { _internalStatesController.dispose(); - if (widget.focusNode == null) { - _focusNode.dispose(); - } super.dispose(); } diff --git a/packages/flutter/test/material/search_anchor_test.dart b/packages/flutter/test/material/search_anchor_test.dart index c2af15aad9a..c044bdfc0a4 100644 --- a/packages/flutter/test/material/search_anchor_test.dart +++ b/packages/flutter/test/material/search_anchor_test.dart @@ -6,10 +6,9 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'; void main() { - testWidgetsWithLeakTracking('SearchBar defaults', (WidgetTester tester) async { + testWidgets('SearchBar defaults', (WidgetTester tester) async { final ThemeData theme = ThemeData(useMaterial3: true); final ColorScheme colorScheme = theme.colorScheme;