有一个CupertinoTimePicker小部件可以执行此操作
看一下这个
class Cupert extends StatefulWidget {
@override
_CupertState createState() => _CupertState();
}
class _CupertState extends State<Cupert> {
var value = "";
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: SafeArea(
child: Column(
children: <Widget>[
Expanded(
child: Center(
child: Text(
"$value"
),
),
),
CupertinoTimerPicker(
mode: CupertinoTimerPickerMode.hm,
onTimerDurationChanged: (value){
setState(() {
this.value = value.toString();
});
},
),
],
),
),
);
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3344 次 |
最近记录: |