title: Flutter TextField "Changing the content within the the composing region may cause the input"
body: <p>I created a new Flutter app and I'm trying to set an initial value in a <code>TextField</code> widget using a process I've used before in several apps. Whenever I edit content in the field, the Android Studio Run window displays:</p>
  <pre><code>W/TextInputPlugin(18696): Changing the content within the the composing region may cause the input method to behave strangely, and is therefore discouraged. See https://github.com/flutter/flutter/issues/78827 for more details
  W/IInputConnectionWrapper(18696): getTextBeforeCursor on inactive InputConnection
  W/IInputConnectionWrapper(18696): getSelectedText on inactive InputConnection
  W/IInputConnectionWrapper(18696): getTextAfterCursor on inactive InputConnection
  W/IInputConnectionWrapper(18696): beginBatchEdit on inactive InputConnection
  W/IInputConnectionWrapper(18696): getTextBeforeCursor on inactive InputConnection
  W/IInputConnectionWrapper(18696): endBatchEdit on inactive InputConnection
  </code></pre>
  <p>When I look at the referenced link, I don't see anything there that describes the solution.</p>
  <p>To test this, I made a new, clean app with just a <code>Text</code> widget and the <code>TextEdit</code> widget and I still get the same issue. I'm not doing anything except setting the default value. Ultimately I want to capture changes to the input field and write the value to local storage, but I thought I'd fix this input error first.</p>
  <p>Here's the code for my test app:</p>
  <pre class="lang-dart prettyprint-override"><code>import 'package:flutter/material.dart';
  
  const appName = 'TextField Test';
  
  void main() {
    runApp(MyApp());
  }
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: appName,
        debugShowCheckedModeBanner: false,
        theme: ThemeData.light(),
        darkTheme: ThemeData.dark(),
        home: HomePage(title: appName),
      );
    }
  }
  
  class HomePage extends StatefulWidget {
    HomePage({Key? key, required this.title}) : super(key: key);
    final String title;
  
    @override
    _HomePageState createState() =&gt; _HomePageState();
  }
  
  class _HomePageState extends State&lt;HomePage&gt; {
    late TextEditingController textEditingController;
    String _inputValue = '';
  
    @override
    void initState() {
      super.initState();
      textEditingController = TextEditingController(text: _inputValue);
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
          appBar: AppBar(
            title: Text(widget.title),
          ),
          body: Padding(
            padding: const EdgeInsets.all(10.0),
            child:
                Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
              Text('This is some content in a Text widget'),
              SizedBox(height: 10),
              TextField(
                autofocus: true,
                decoration: InputDecoration(
                    border: OutlineInputBorder(),
                    hintText: 'Enter some text here'),
                controller: textEditingController,
              ),
            ]),
          ));
    }
  }
  
  </code></pre>
  <p>Can someone please tell me what I'm doing wrong?</p>
  <p>When I add a listener to the controller, I noticed that its firing multiple times for every character I type:</p>
  <pre><code>I/flutter (18696): Listener fired the e
  I/flutter (18696): Listener fired the e
  I/flutter (18696): Listener fired the en
  I/flutter (18696): Listener fired the en
  </code></pre>
  <p>Here's the listener code:</p>
  <pre class="lang-dart prettyprint-override"><code> @override
    void initState() {
      super.initState();
      textEditingController = TextEditingController(text: _inputValue);
      textEditingController.addListener(() {
        print('Listener fired ${textEditingController.text}');
      });
    }
  </code></pre>