Would anyone know how to create an age range slider in flutter? A slider which will have two input values. Somewhat like what Tinder has to choose min and max age. a slider
Flutter Version 1.20.0
We having an update for RangeSlider with the label.
class RangeWidget extends StatefulWidget {
@override
State createState() => _RangeWidget();
}
class _RangeWidget extends State {
RangeValues _currentRangeValues = const RangeValues(0, 100);
static String _valueToString(double value) {
return value.toStringAsFixed(0);
}
@override
Widget build(BuildContext context) {
return new Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
RangeSlider(
values: _currentRangeValues,
min: 0,
max: 100,
divisions: 10,
labels: RangeLabels(
_currentRangeValues.start.round().toString(),
_currentRangeValues.end.round().toString(),
),
onChanged: (RangeValues values) {
setState(() {
_currentRangeValues = values;
});
},
)
],
);
}
}