diff --git a/lib/pages/mood_page.dart b/lib/pages/mood_page.dart index a8c4a4e..0e76795 100644 --- a/lib/pages/mood_page.dart +++ b/lib/pages/mood_page.dart @@ -1,10 +1,11 @@ import 'package:flutter/material.dart'; +import 'package:smoke_cess_app/widgets/slider.dart'; class MoodPage extends StatelessWidget { const MoodPage({super.key}); @override Widget build(BuildContext context) { - return const Center(child: Text('Hier Fragen wir die Stimmung ab')); + return Column(children: const [MySlider(), Text('Freitext')]); } } diff --git a/lib/widgets/slider.dart b/lib/widgets/slider.dart new file mode 100644 index 0000000..2d800e2 --- /dev/null +++ b/lib/widgets/slider.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; + +class MySlider extends StatefulWidget { + const MySlider({super.key}); + + @override + State createState() => SliderState(); +} + +class SliderState extends State { + double _currentSliderValue = 50; + + @override + Widget build(BuildContext context) { + return Row( + children: [ + Slider( + value: _currentSliderValue, + max: 100, + label: _currentSliderValue.round().toString(), + onChanged: (double value) => + {setState((() => _currentSliderValue = value))}), + Text(_currentSliderValue.round().toString()) + ], + ); + } +}