title: Range slider in bottom sheet not working in flutter
body: <p>I am stuck here where my range slider is not working when I am using it on the bottom sheet.
  I am getting 0 errors so I don't know where it is stuck.
  this function is working fine when I use it in the build function but not in the bottom sheet.
  below is the code for it -:</p>
  <pre><code>RangeValues Myheight = const RangeValues(150, 180);
   
    @override
    Widget build(BuildContext context) {
  
      return Scaffold(
        body: InkWell(
                    child: TextField(
                      controller: interest,
                      decoration: InputDecoration(
                        enabled: false,
                        suffixIcon: Padding(
                          padding: EdgeInsets.only(top: 15),
                          // add padding to adjust icon
                          child: Icon(Icons.add),
                        ),
                        prefixIcon: Padding(
                          padding: EdgeInsets.only(top: 15),
                          // add padding to adjust icon
                          child: Icon(Icons.favorite_border_rounded),
                        ),
                      ),
                    ),
                    onTap: () {
                      _bottomSheet(context, Myheight);
                    },
                  ),
      );
    }
  
  
      _bottomSheet(context, myheight) {
      showModalBottomSheet(
          context: context,
          builder: (BuildContext c) {
            return Container(
              height: 250,
              child: Row(
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  Flexible(
                    fit: FlexFit.loose,
                    child: Container(
                      height: 180,
                      child: ReusableCard(
                        colors: kActiveCardColor,
                        cardChild: Column(
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: &lt;Widget&gt;[
                            Text(
                              'HEIGHT',
                              style: kLabelStyle,
                            ),
                            Row(
                              mainAxisAlignment: MainAxisAlignment.center,
                              crossAxisAlignment: CrossAxisAlignment.baseline,
                              textBaseline: TextBaseline.alphabetic,
                              children: &lt;Widget&gt;[
                                Text(
                                  '${myheight.start.round().toString()} - ${myheight.end.round().toString()}',
                                  style: kNumberStyle,
                                ),
                                Text(
                                  'cm',
                                  style: kLabelStyle,
                                ),
                              ],
                            ),
                            SliderTheme(
                              data: SliderTheme.of(context).copyWith(
                                activeTrackColor: Colors.pink,
                                inactiveTrackColor: Color(0xFF8D8E98),
                                thumbColor: Color(0xFFEB1555),
                                thumbShape:
                                RoundSliderThumbShape(enabledThumbRadius: 15),
                                overlayShape:
                                RoundSliderOverlayShape(overlayRadius: 30.0),
                                overlayColor: Color(0x29EB1555),
                                showValueIndicator: ShowValueIndicator.always,
                              ),
                              child: RangeSlider(
                                values: myheight,
                                min: 100,
                                max: 220,
                                labels: RangeLabels('${myheight.start.round()}', '${myheight.end.round()}'),
                                // divisions: 10,
                                onChanged: (RangeValues newValue) {
                                  setState(() {
                                    myheight = newValue;
                                  });
                                },
                              ),
                            ),
                          ],
                        ),
                      ),
                    ),
                  ),
  
                ],
              ),
            );
          });
    }
  
  </code></pre>
  <p>I am calling this on Textfield tap where I am passing the variable.
  please let me know any solution.</p>
  <p>below is the image for the working and non-working Range slider respectively. -:
  <a href="https://i.stack.imgur.com/aiWjk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aiWjk.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/zvwQV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zvwQV.png" alt="enter image description here" /></a></p>
  <p>below is the image for the edit of the code -:
  <a href="https://i.stack.imgur.com/lUZVR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lUZVR.png" alt="enter image description here" /></a></p>
  <p>edit -: this my edited code ..</p>
  <pre><code>  _bottomHeightSheet(context) {
        RangeValues Myheight = const RangeValues(150, 180);
  
        showModalBottomSheet(
          context: context,
          builder: (BuildContext c) {
            return StatefulBuilder(
              builder: (BuildContext context,
                  void Function(void function()) setState){ // getting error in this line
                return Container(
                  height: 250,
                  child: Row(
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      Flexible(
                        fit: FlexFit.loose,
                        child: Container(
                          height: 180,
                          child: ReusableCard(
                            colors: kActiveCardColor,
                            cardChild: Column(
                              mainAxisAlignment: MainAxisAlignment.center,
                              children: &lt;Widget&gt;[
                                Text(
                                  'HEIGHT',
                                  style: kLabelStyle,
                                ),
                                Row(
                                  mainAxisAlignment: MainAxisAlignment.center,
                                  crossAxisAlignment: CrossAxisAlignment.baseline,
                                  textBaseline: TextBaseline.alphabetic,
                                  children: &lt;Widget&gt;[
                                    Text(
                                      '${Myheight.start.round().toString()} - ${Myheight.end.round().toString()}',
                                      style: kNumberStyle,
                                    ),
                                    Text(
                                      'cm',
                                      style: kLabelStyle,
                                    ),
                                  ],
                                ),
                                SliderTheme(
                                  data: SliderTheme.of(context).copyWith(
                                    activeTrackColor: Colors.pink,
                                    inactiveTrackColor: Color(0xFF8D8E98),
                                    thumbColor: Color(0xFFEB1555),
                                    thumbShape:
                                    RoundSliderThumbShape(enabledThumbRadius: 15),
                                    overlayShape:
                                    RoundSliderOverlayShape(overlayRadius: 30.0),
                                    overlayColor: Color(0x29EB1555),
                                    showValueIndicator: ShowValueIndicator.always,
                                  ),
                                  child: RangeSlider(
                                    values: Myheight,
                                    min: 100,
                                    max: 220,
                                    labels: RangeLabels('${Myheight.start.round()}', '${Myheight.end.round()}'),
                                    // divisions: 10,
                                    onChanged: (RangeValues newValue) {
                                      setState(() {
                                        Myheight = newValue;
                                      });
                                    },
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ),
  
                    ],
                  ),
                );
                },
              );
          });
    }
  
  </code></pre>