diff --git a/AUTHORS b/AUTHORS index 265c7daf4b..2b9f1a8a2b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -36,3 +36,4 @@ TruongSinh Tran-Nguyen Sander Dalby Larsen Marco Scannadinari Frederik Schweiger +Martin Staadecker diff --git a/examples/flutter_gallery/lib/demo/material/slider_demo.dart b/examples/flutter_gallery/lib/demo/material/slider_demo.dart index 1c28d1fe2f..d825f5df3b 100644 --- a/examples/flutter_gallery/lib/demo/material/slider_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/slider_demo.dart @@ -159,6 +159,49 @@ class _SliderDemoState extends State { const Text('Continuous'), ], ), + Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + children: [ + Expanded( + child: Slider( + value: _value, + min: 0.0, + max: 100.0, + onChanged: (double value) { + setState(() { + _value = value; + }); + }, + ), + ), + Semantics( + label: 'Editable numerical value', + child: Container( + width: 48, + height: 48, + child: TextField( + onSubmitted: (String value) { + final double newValue = double.tryParse(value); + if (newValue != null && newValue != _value) { + setState(() { + _value = newValue.clamp(0, 100); + }); + } + }, + keyboardType: TextInputType.number, + controller: TextEditingController( + text: _value.toStringAsFixed(0), + ), + ), + ), + ), + ], + ), + const Text('Continuous with Editable Numerical Value'), + ], + ), Column( mainAxisSize: MainAxisSize.min, children: const [