Revert "_SearchBarState should dispose FocusNode, if it created it." (#134072)
Reverts flutter/flutter#133947 as it causes build failures.
This commit is contained in:
parent
e66ec8e0b0
commit
e30f9c4218
@ -1179,9 +1179,6 @@ class _SearchBarState extends State<SearchBar> {
|
|||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_internalStatesController.dispose();
|
_internalStatesController.dispose();
|
||||||
if (widget.focusNode == null) {
|
|
||||||
_focusNode.dispose();
|
|
||||||
}
|
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,10 +6,9 @@ import 'dart:ui';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
testWidgetsWithLeakTracking('SearchBar defaults', (WidgetTester tester) async {
|
testWidgets('SearchBar defaults', (WidgetTester tester) async {
|
||||||
final ThemeData theme = ThemeData(useMaterial3: true);
|
final ThemeData theme = ThemeData(useMaterial3: true);
|
||||||
final ColorScheme colorScheme = theme.colorScheme;
|
final ColorScheme colorScheme = theme.colorScheme;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user