Repository: flutter
Issue: Using WidgetTester.enterText on a disabled TextFormField breaks future calls
Labels: a: tests,a: text input,framework,has reproducible steps,P2,found in release: 2.5,found in release: 2.6,team-framework,triaged-framework

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Steps to Reproduce

<!-- You must include full steps to reproduce so that we can reproduce the problem. -->

1. Use `enterText` on a `TextFormField`. See that it works.
2. Disable and renable the form and see that `enterText` continues to work.
3. This time, disable the field and use `enterText`. See that does not change the text value, as expected.
4. Re-enable the field and see that `enterText` doesn't work despite being enabled again.

`enterText` only breaks after having used it on a disabled field and then re-enabling it.

Here is an example of a failing test when the commented line is uncommented:

```
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

class TestFieldDisable extends StatefulWidget {
    @override
    State<StatefulWidget> createState() => TestFieldDisableState();
}

class TestFieldDisableState extends State<TestFieldDisable> {

    bool _enabled = true;

    set enabled(bool to) => setState(() {
        _enabled = to;
    });

    @override
    Widget build(BuildContext context) => TextFormField(enabled: _enabled);

}

void main() {

    testWidgets("TextFormField should accept text when renabled", (tester) async {

        await tester.pumpWidget(
            MaterialApp(home: Scaffold(body: TestFieldDisable()))
        );

        final disablerState = tester.state<TestFieldDisableState>(
            find.byType(TestFieldDisable)
        );

        final fieldFinder = find.byType(TextFormField);
        final fieldState = tester.state<FormFieldState>(fieldFinder);

        await tester.enterText(fieldFinder, "one");
        await tester.pump();
        expect(fieldState.value, "one");

        disablerState.enabled = false;
        await tester.pump();

        // await tester.enterText(fieldFinder, "two"); // Uncomment to break
        await tester.pump();
        expect(fieldState.value, "one");

        disablerState.enabled = true;
        await tester.pump();

        await tester.enterText(fieldFinder, "two");
        await tester.pump();
        expect(fieldState.value, "two");

    });

}
```

**Expected results:**

`enterText` should continue to work when the field is enabled again.

**Actual results:**

The final `expect` fails due to remaining as "one" instead of "two".

<details>
  <summary>Logs</summary>

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel stable, 2.5.1, on Debian GNU/Linux 10 (buster) 4.19.0-17-amd64, locale en_GB.UTF-8)
    • Flutter version 2.5.1 at...
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ffb2ecea52 (2 days ago), 2021-09-17 15:26:33 -0400
    • Engine revision b3af521a05
    • Dart version 2.14.2
```

</details>