Skip to content

Commit

Permalink
_DropdownMenuState should dispose TextEditingController. (#133914)
Browse files Browse the repository at this point in the history
  • Loading branch information
polina-c authored Sep 6, 2023
1 parent 03fcfbe commit 03b60ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/flutter/lib/src/material/dropdown_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,9 @@ class _DropdownMenuState<T> extends State<DropdownMenu<T>> {

@override
void dispose() {
if (widget.controller == null) {
_textEditingController.dispose();
}
super.dispose();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void main() {
expect(material.textStyle?.color, themeData.colorScheme.onSurface);
});

testWidgets('ThemeData.dropdownMenuTheme overrides defaults', (WidgetTester tester) async {
testWidgetsWithLeakTracking('ThemeData.dropdownMenuTheme overrides defaults', (WidgetTester tester) async {
final ThemeData theme = ThemeData(
dropdownMenuTheme: DropdownMenuThemeData(
textStyle: TextStyle(
Expand Down

0 comments on commit 03b60ac

Please sign in to comment.