flutter - Flutter how to show Time Picker as widget
问题描述
I need to implement time picker as a widget . I don't need it in modal or dialogue . I need it to be shown in container .any resources or guidlines are appreciated.
解决方案
您可以使用CupertinoTimePicker
.
return Scaffold(
body: Center(
child: Container(
height: 200,
child: Card(
elevation: 4,
child: Row(
children: <Widget>[
SizedBox(
width: 100,
child: Text("Select a time"),
),
Expanded(
child: CupertinoTimerPicker(
mode: CupertinoTimerPickerMode.hm,
onTimerDurationChanged: (data) {},
),
),
],
),
),
),
),
);
结果:
推荐阅读
- reactjs - 将 Select.Creatable 与 React 最终形式一起使用
- okhttp - 使用 OkHttp 版本 4.0.0-RC1 编译时出现问题
- firebase - 不能使用 firebase.messaging() 函数
- python - 通过 python 中的 selenium 驱动程序将图像导入谷歌表单
- multiprocessing - 使用 Spacy 训练 NER 模型仅使用一个核心
- oracle - 如何在plsql中使用函数创建新表和插入?
- c# - 如何从两个表中删除数据?
- r - 禁忌文字或不受欢迎的注释
- html - 无法使页面上的某些元素响应?
- android - 如何在 Typescript 中使用 Nativescript 和 Mapbox 应用变量的更改