title: Cannot figure out why my Slider won't rebuild
body: <p>First of all, I'm new to coding so please don't roast me too hard. I've spent my whole sunday afternoon trying to figure out how to make this work.</p>
  <p>Basically I want to have 3 sliders but all with a different initial value. I thought it's a smart idea to put the code for this into a builder method and just call the builder method 3 times in the widget tree to make my code cleaner.</p>
  <p>My problem is that when setState gets called it won't rebuild the Slider.</p>
  <pre><code>class _HomeScreenState extends State&lt;HomeScreen&gt; {
    double pomodoro = 25;
    double shortBreak = 5;
    double longBreak = 20;
  
    Widget _slider({
      required String name,
      required int divisions,
      required double minValue,
      required double maxValue,
      required double duration,
    }) {
      return Slider(
        min: minValue,
        max: maxValue,
        divisions: divisions,
        value: duration,
        onChanged: (newDuration) {
          setState(() =&gt; duration = newDuration);
        },
      );
    }
  </code></pre>
  <p>Now if instead of 'duration' I put 'pomodoro' in setState then everything works fine and the slider rebuilds but that would make the whole builder method obsolete since I want different initial values each time i call that method. How do I make this work?</p>