Unverified Commit 03b60ac7 authored by Polina Cherkasova's avatar Polina Cherkasova Committed by GitHub

_DropdownMenuState should dispose TextEditingController. (#133914)

parent 03fcfbef
...@@ -541,6 +541,9 @@ class _DropdownMenuState<T> extends State<DropdownMenu<T>> { ...@@ -541,6 +541,9 @@ class _DropdownMenuState<T> extends State<DropdownMenu<T>> {
@override @override
void dispose() { void dispose() {
if (widget.controller == null) {
_textEditingController.dispose();
}
super.dispose(); super.dispose();
} }
......
...@@ -100,7 +100,7 @@ void main() { ...@@ -100,7 +100,7 @@ void main() {
expect(material.textStyle?.color, themeData.colorScheme.onSurface); 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( final ThemeData theme = ThemeData(
dropdownMenuTheme: DropdownMenuThemeData( dropdownMenuTheme: DropdownMenuThemeData(
textStyle: TextStyle( textStyle: TextStyle(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment