import 'package:flutter/material.dart'; double _currentSliderValue = 50; class MySlider extends StatefulWidget { const MySlider({super.key}); @override State createState() => SliderState(); double getSliderValue() { return _currentSliderValue; } } class SliderState extends State { @override Widget build(BuildContext context) { return Column( children: [ const Text('Bewerte deine Stimmung'), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Slider( value: _currentSliderValue, max: 100, label: _currentSliderValue.round().toString(), onChanged: (double value) => {setState((() => _currentSliderValue = value))}), Text(_currentSliderValue.round().toString()) ], ) ], ); } }