【发布时间】:2021-05-04 16:21:55
【问题描述】:
假设我有以下代码,
Widget _myListView(BuildContext context) {
return ListView(
children: <Widget>[
ListTile(
title: Text('Sun'),
onTap:() async{
await showDialog<String>(
context:context,
--- not sure how to proceed from here --
}
}
Navigator.pop(context); //this code makes sure it go back to another page after done with the input processing.
),
ListTile(
title: Text('Moon'),
),
ListTile(
title: Text('Star'),
),
],
);
}
如何使用输入 onTap ListTile,运行一些方法来使用输入,然后弹回上一页。
【问题讨论】: