diff --git a/packages/flutter/lib/src/widgets/form.dart b/packages/flutter/lib/src/widgets/form.dart index 07476568a35..ca980ad9330 100644 --- a/packages/flutter/lib/src/widgets/form.dart +++ b/packages/flutter/lib/src/widgets/form.dart @@ -573,6 +573,13 @@ class FormFieldState extends State> with RestorationMixin { super.deactivate(); } + @override + void dispose() { + _errorText.dispose(); + _hasInteractedByUser.dispose(); + super.dispose(); + } + @override Widget build(BuildContext context) { if (widget.enabled) { diff --git a/packages/flutter/test/material/text_form_field_test.dart b/packages/flutter/test/material/text_form_field_test.dart index f95f8bfaaa5..8877ed8e9ec 100644 --- a/packages/flutter/test/material/text_form_field_test.dart +++ b/packages/flutter/test/material/text_form_field_test.dart @@ -247,9 +247,6 @@ void main() { }, variant: const TargetPlatformVariant({ TargetPlatform.linux, TargetPlatform.windows }), 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/130467 - leakTrackingTestConfig: const LeakTrackingTestConfig(allowAllNotDisposed: true, allowAllNotGCed: true), ); testWidgetsWithLeakTracking(