在 Flutter 的 DropDownButton 中选择项目后重新加载页面和过滤数据?
Reload Page and Filter data After selecting item in DropDownButton in Flutter?
我有一个页面显示休息 Api 中的所有产品。在同一页面上,我有一个 DropDownButton
,其中填充了各种类别。我的问题是如何在从下拉按钮中选择一个项目后过滤数据并使用过滤后的数据重新加载页面?
能够像这样为任何可能有帮助的人解决问题。
InkWell(
onTap: () {
clearimage();
},
child: Row(
children: <Widget>[
Icon(
Icons.cancel,
color: red,
size: 13.0,
),
Padding(
padding: const EdgeInsets.only(
left: 15.0),
child: Text(
"Remove",
style: TextStyle(fontSize: 10),
),
),
],
),
),
我调用了一个方法clearimage();
我不得不File _mage
回到null
clearimage() {
setState(() {
_image = null;
});
}
我有一个页面显示休息 Api 中的所有产品。在同一页面上,我有一个 DropDownButton
,其中填充了各种类别。我的问题是如何在从下拉按钮中选择一个项目后过滤数据并使用过滤后的数据重新加载页面?
能够像这样为任何可能有帮助的人解决问题。
InkWell(
onTap: () {
clearimage();
},
child: Row(
children: <Widget>[
Icon(
Icons.cancel,
color: red,
size: 13.0,
),
Padding(
padding: const EdgeInsets.only(
left: 15.0),
child: Text(
"Remove",
style: TextStyle(fontSize: 10),
),
),
],
),
),
我调用了一个方法clearimage();
我不得不File _mage
回到null
clearimage() {
setState(() {
_image = null;
});
}