You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
659 B

import 'package:flutter/cupertino.dart';
class SliderPage extends StatefulWidget {
const SliderPage({super.key});
@override
State<SliderPage> createState() => _SliderPageState();
}
class _SliderPageState extends State<SliderPage> {
double _value = 0.5;
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(middle: Text('Slider')),
child: Center(
child: CupertinoSlider(
value: _value,
onChanged: (double value) {
setState(() {
_value = value;
});
},
),
),
);
}
}