我有一个屏幕,其中包含ExpansionTile
并且我们知道它ExpansionTile
具有children
属性。我想做的事情是我需要捕获 的触发器click
,ExpansionTile
所以当用户单击ExpansionTile
它时,它将运行 FutureBuilder 以从 API 获取数据,有没有办法做到这一点。因为直到现在……ExpansionTile
总是和孩子们一起跑这里是部分代码
ExpansionTile(
children:[] //here.. I would like to call the data from api, when user click the expansiontile
title: Text(
"${dataAll["data"][i]["lowongan"]}",
style: GoogleFonts.poppins(
fontWeight: FontWeight.w600,
color: isHovered ||
listLokerModel.value
.lokerState[i]
? dark_button
: Colors.white,
fontSize: 20)),
subtitle: Text(
"${dataAll["data"][i]["start"]} - ${dataAll["data"][i]["end"]}",
style: GoogleFonts.poppins(
color: isHovered ||
listLokerModel.value
.lokerState[i]
? dark_button
: Colors.white,
fontSize: 16)),
trailing: Icon(
Icons.keyboard_arrow_down_sharp,
color: isHovered ||
listLokerModel
.value.lokerState[i]
? dark_button
: Colors.white,
))