Ok, I didn't fix it. It was to complex for me as a beginner.
I found another solution.
I made a row, with three children:
a minus button and a plus button for fine tuning
a slider-bar for the big steps.
This is the code I used, do you have better solutions, let me know. I just place it for other beginners like me.
I want to thank special @Abbas.M who tried to help me.
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
AnimatedOpacity(
opacity: height == 1 ? 0.0 : 1.0,
duration: Duration(milliseconds: 500),
child: RawMaterialButton(
child: Icon(MdiIcons.minus),
onPressed: () {
setState(() {
height > 1 ? height-- : height = height;
});
},
constraints: BoxConstraints.tightFor(
width: 25.0,
height: 25.0,
),
shape: CircleBorder(),
fillColor: white,
),
),
SliderTheme(
data: SliderTheme.of(context).copyWith(
inactiveTrackColor: cAppBottomBar,
activeTrackColor: white,
thumbColor: white,
overlayColor: cShadow,
thumbShape:
RoundSliderThumbShape(enabledThumbRadius: 10.0),
overlayShape:
RoundSliderOverlayShape(overlayRadius: 17.0),
),
child: Slider(
value: height.toDouble(),
min: 1,
max: 300,
onChanged: (value) {
setState(() {
height = value.toInt();
});
}),
),
AnimatedOpacity(
opacity: height == 300 ? 0.0 : 1.0,
duration: Duration(milliseconds: 500),
child: RawMaterialButton(
child: Icon(Icons.add),
onPressed: () {
setState(() {
height < 300 ? height++ : height = height;
});
},
constraints: BoxConstraints.tightFor(
width: 25.0,
height: 25.0,
),
shape: CircleBorder(),
fillColor: white,
),
),