From 0ea523cf9318a33932d012b0355a24b8157d0a33 Mon Sep 17 00:00:00 2001 From: Polina Cherkasova Date: Wed, 16 Aug 2023 15:38:59 -0700 Subject: [PATCH] Fix not-disposed _InputBorderGap. (#132694) Fixes: https://github.com/flutter/flutter/issues/132620 --- packages/flutter/lib/src/material/input_decorator.dart | 1 + packages/flutter/test/material/text_form_field_test.dart | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart index ecfd98ab8568..dd1e2bdf34dc 100644 --- a/packages/flutter/lib/src/material/input_decorator.dart +++ b/packages/flutter/lib/src/material/input_decorator.dart @@ -1956,6 +1956,7 @@ class _InputDecoratorState extends State with TickerProviderStat void dispose() { _floatingLabelController.dispose(); _shakingLabelController.dispose(); + _borderGap.dispose(); super.dispose(); } diff --git a/packages/flutter/test/material/text_form_field_test.dart b/packages/flutter/test/material/text_form_field_test.dart index d830020fde29..f95f8bfaaa53 100644 --- a/packages/flutter/test/material/text_form_field_test.dart +++ b/packages/flutter/test/material/text_form_field_test.dart @@ -243,6 +243,7 @@ void main() { expect(controller.text, ' blah2blah1'); expect(controller.selection, const TextSelection(baseOffset: 0, extentOffset: 0)); expect(find.byType(CupertinoButton), findsNothing); + controller.dispose(); }, variant: const TargetPlatformVariant({ TargetPlatform.linux, TargetPlatform.windows }), skip: kIsWeb, // [intended] we don't supply the cut/copy/paste buttons on the web. @@ -278,11 +279,6 @@ void main() { controller.dispose(); }, skip: kIsWeb, // [intended] we don't supply the cut/copy/paste buttons on the web. - // TODO(polina-c): remove after fixing - // https://github.com/flutter/flutter/issues/132620 - leakTrackingTestConfig: const LeakTrackingTestConfig( - notDisposedAllowList: {'_InputBorderGap' : 1}, - ), ); testWidgets('the desktop cut/copy/paste buttons are disabled for read-only obscured form fields', (WidgetTester tester) async {