Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
0d198c7b
Unverified
Commit
0d198c7b
authored
Sep 07, 2023
by
Polina Cherkasova
Committed by
GitHub
Sep 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SearchDelegate should dispose resources. (#133948)
parent
2867b31f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
search.dart
packages/flutter/lib/src/material/search.dart
+9
-0
search_test.dart
packages/flutter/test/material/search_test.dart
+3
-1
segmented_button_test.dart
packages/flutter/test/material/segmented_button_test.dart
+1
-3
No files found.
packages/flutter/lib/src/material/search.dart
View file @
0d198c7b
...
...
@@ -377,6 +377,15 @@ abstract class SearchDelegate<T> {
}
_SearchPageRoute
<
T
>?
_route
;
/// Releases the resources.
@mustCallSuper
void
dispose
()
{
_currentBodyNotifier
.
dispose
();
_focusNode
?.
dispose
();
_queryTextController
.
dispose
();
_proxyAnimation
.
parent
=
null
;
}
}
/// Describes the body that is currently shown under the [AppBar] in the
...
...
packages/flutter/test/material/search_test.dart
View file @
0d198c7b
...
...
@@ -6,6 +6,7 @@ import 'package:flutter/foundation.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
import
'../widgets/clipboard_utils.dart'
;
import
'../widgets/semantics_tester.dart'
;
...
...
@@ -25,8 +26,9 @@ void main() {
TestDefaultBinaryMessengerBinding
.
instance
.
defaultBinaryMessenger
.
setMockMethodCallHandler
(
SystemChannels
.
platform
,
null
);
});
testWidgets
(
'Changing query moves cursor to the end of query'
,
(
WidgetTester
tester
)
async
{
testWidgets
WithLeakTracking
(
'Changing query moves cursor to the end of query'
,
(
WidgetTester
tester
)
async
{
final
_TestSearchDelegate
delegate
=
_TestSearchDelegate
();
addTearDown
(()
=>
delegate
.
dispose
());
await
tester
.
pumpWidget
(
TestHomePage
(
delegate:
delegate
));
await
tester
.
tap
(
find
.
byTooltip
(
'Search'
));
...
...
packages/flutter/test/material/segmented_button_test.dart
View file @
0d198c7b
...
...
@@ -22,9 +22,7 @@ Widget boilerplate({required Widget child}) {
void
main
(
)
{
testWidgetsWithLeakTracking
(
'SegmentedButton is built with Material of type MaterialType.transparency'
,
leakTrackingTestConfig:
LeakTrackingTestConfig
.
debugNotDisposed
(),
(
WidgetTester
tester
)
async
{
testWidgetsWithLeakTracking
(
'SegmentedButton is built with Material of type MaterialType.transparency'
,
(
WidgetTester
tester
)
async
{
final
ThemeData
theme
=
ThemeData
(
useMaterial3:
true
);
await
tester
.
pumpWidget
(
MaterialApp
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment