mirror of https://github.com/flutter/samples.git
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.
32 lines
676 B
32 lines
676 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;
|
|
});
|
|
},
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|