Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ class _NetworkProfilerControlsState extends State<_NetworkProfilerControls>
_recording = controller.recordingNotifier.value;
});
});

addAutoDisposeListener(controller.filteredData);
}

@override
Expand All @@ -205,7 +203,6 @@ class _NetworkProfilerControlsState extends State<_NetworkProfilerControls>
}

final screenWidth = ScreenSize(context).width;
final hasRequests = controller.filteredData.value.isNotEmpty;
return Column(
Comment thread
ishaquehassan marked this conversation as resolved.
children: [
Row(
Expand Down Expand Up @@ -233,7 +230,6 @@ class _NetworkProfilerControlsState extends State<_NetworkProfilerControls>
Expanded(
child: SearchField<NetworkController>(
searchController: controller,
searchFieldEnabled: hasRequests,
searchFieldWidth: screenWidth <= MediaSize.xs
? defaultSearchFieldWidth
: wideSearchFieldWidth,
Expand Down
4 changes: 3 additions & 1 deletion packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ TODO: Remove this section if there are not any updates.

## Network profiler updates

TODO: Remove this section if there are not any updates.
* Fixed the Network tab search field becoming disabled after clearing all
requests, so the search query can now be edited at any time. -
[#9855](https://github.com/flutter/devtools/pull/9855)

## Logging updates

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,48 @@ void main() {
// Wait to ensure all the timers have been cancelled.
await tester.pumpAndSettle(const Duration(seconds: 2));
});

testWidgetsWithWindowSize(
'search field stays enabled after clearing',
windowSize,
(WidgetTester tester) async {
// Load the network profiler screen.
controller = NetworkController();
await pumpNetworkScreen(tester);

// Populate the screen with requests.
await loadRequestsAndCheck(tester);

Finder searchFieldTextField() => find.descendant(
of: find.byType(SearchField<NetworkController>),
matching: find.byType(TextField),
);

// The search field is enabled while requests are present.
expect(
tester.widget<TextField>(searchFieldTextField()).enabled,
isTrue,
);

// Pause the profiler so polling does not repopulate the requests after
// they are cleared below.
await tester.tap(find.byType(StartStopRecordingButton));
await tester.pumpAndSettle();

// Clear the results.
await tester.tap(find.byType(ClearButton));
await tester.pumpAndSettle(const Duration(seconds: 2));
expect(controller.requests.value, isEmpty);

// The search field must stay enabled even with no requests present, so
// the query can still be edited before the next batch of requests
// arrives.
expect(
tester.widget<TextField>(searchFieldTextField()).enabled,
isTrue,
);
},
);
});

group('NetworkRequestOverviewView', () {
Expand Down