title: How to set customized data model with Flutter Slider
body: <p>I have a customized data model called <code>Item</code> with property <code>emotionLevel</code>, on the page, I have a list of cards that have a "Emotion Slider". </p>
  
  <p>I would like to set the <code>Item.emotionLevel</code> based off the slider value, but for some reason the following code does not work (Slider stuck, can't be moved):</p>
  
  <pre><code>            new Slider(
                  value: item.emotionLevel,
                  min: 1.0,
                  max: 5.0,
                  divisions: 4,
                  activeColor: Colors.blue,
                  inactiveColor: Colors.black,
                  label: 'Set a value',
                  onChanged: (double newValue) {
                    setState(() {
                      item.emotionLevel = newValue;
                    });
                  },
                  semanticFormatterCallback: (double newValue) {
                    return '${newValue.round()} dollars';
                  })
  </code></pre>
  
  <p>Can someone please help point me to the right direction on how to implement a slider that able to set customized data model ? thank you. </p>