title: The following FormatException was thrown while calling onChanged: Invalid number (at character 1)
body: <p>I am trying to clear the initial value from and textfield and give new value, when the textfield is empty i am getting this error.</p>
  <pre><code>The following FormatException was thrown while calling onChanged:
  Invalid number (at character 1)
  
  ^
  
  When the exception was thrown, this was the stack: 
  #0      int._handleFormatError (dart:core-patch/integers_patch.dart:129:7)
  #1      int.parse (dart:core-patch/integers_patch.dart:55:14)
  </code></pre>
  <p>Below is my code.</p>
  <pre><code>  int _currentSliderValue = 1;
    TextEditingController sliderController = TextEditingController();
  
  Column(
              children: [
                Slider(
                  value: _currentSliderValue.toDouble(),
                  max: 100,
                  label: _currentSliderValue.round().toString(),
                  onChanged: (double value) {
                    setState(() {
                      _currentSliderValue = value.toInt();
                      sliderController.text = _currentSliderValue.toString();
                      print(_currentSliderValue);
                    });
                  },
                ),
                Padding(
                  padding: const EdgeInsets.all(0.0),
                  child: TextFormField(
                    decoration: InputDecoration(
                      border: OutlineInputBorder(),
                    ),
                    controller: sliderController,
                    onChanged: (text) {
                      setState(() {
                        _currentSliderValue = int.parse(text);
                      });
                    },
                  ),
                ),
              ],
            )
  </code></pre>
  <p>How to overcome this issue. i don't get any error when i add any values.</p>
  <p>Please help me how to fix this. Thanks in advance.</p>