title: How to keep new TextFormField value on state change?
body: <p>I want create a lot of TextFormField with int value.If user changed TextFormField value   i was set FAB to visible.So user can save new value if he hit the FAB.But there is a problem with Setstate.When user  changed TextFormField value its trigger OnChanged and i was set FAB visible inside setstate.When i was use setState its reset TextFormFields to initial value.How to avoid this problem?</p>
  
  <p>Thanks</p>
  
  <p>Here my sample code </p>
  
  <pre><code>import 'package:flutter/material.dart';
  import 'package:flutter/services.dart';
  
  final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
  bool FabVisible = false;
  final List&lt;TextEditingController&gt; controllers = List.generate(6, (index) {
    return TextEditingController();
  });
  
  void main() {
    runApp(MyApp());
  }
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: darkBlue),
        debugShowCheckedModeBanner: false,
        home: SafeArea(
          child: Scaffold(
            floatingActionButton: FAB(),
            body: Center(
              child: MyWidget(),
            ),
          ),
        ),
      );
    }
  
    FloatingActionButton FAB() {
      return FabVisible
          ? FloatingActionButton(onPressed: () {}, child: Icon(Icons.save))
          : null;
    }
  }
  
  class MyWidget extends StatefulWidget {
    @override
    _MyWidgetState createState() =&gt; _MyWidgetState();
  }
  
  class _MyWidgetState extends State&lt;MyWidget&gt; {
  //  final TextEditingController controller = TextEditingController();
  //  final TextEditingController controller2 = TextEditingController();
  
    @override
    Widget build(BuildContext context) {
      return Column(
        children: &lt;Widget&gt;[
          SingleChildScrollView(
            child: Column(
              children: textFields(),
            ),
          ),
        ],
      );
    }
  
    List&lt;TextFormField&gt; textFields() {
      List&lt;TextFormField&gt; trash = List();
  
      for (int i = 0; i &lt;= 5; i++) {
        TextEditingController controller = controllers[i];
        controller.value = TextEditingValue(
            text: 10.toString(),
            selection: TextSelection.fromPosition(
                TextPosition(offset: (10.toString()).length)));
  
        trash.add(
          TextFormField(
            onChanged: (txt) {
              controller.value = TextEditingValue(
                  text: txt,
                  selection: TextSelection.fromPosition(
                    TextPosition(offset: txt.length),
                  ));
              setState(() {
                FabVisible = true;
              });
            },
            keyboardType: TextInputType.number,
            inputFormatters: [WhitelistingTextInputFormatter.digitsOnly],
            controller: controller,
            style: TextStyle(color: Colors.white),
            textAlign: TextAlign.center,
            decoration: InputDecoration.collapsed(
              hintText: "",
              fillColor: Colors.teal,
              focusColor: Colors.yellow,
            ),
          ),
        );
      }
      return trash;
    }
  }
  </code></pre>