0

我是新来的颤振,正在开发一个调用 api 并从服务器获取数据的应用程序,这些数据显示在底页上。在这种情况下,我在执行 api 调用的同时显示底部工作表。在 api 调用之后,我想更新底部工作表的内容。我使用了一个数据对象来显示底部工作表中的内容。setstate 没有更新已经显示的底页。api调用后如何更新底部工作表内容。

我的 API 调用

model.getSpotDetails(model.spotList[position], position).then((value) =>
      {
        if(value){

        }
      });

我的底片代码

showModalBottomSheet<void>(
      context: context,
      elevation: 5,
      backgroundColor: AppTheme.white,
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.only(topLeft: Radius.circular(20),topRight: Radius.circular(20)),
      ),
      builder: (BuildContext context) {
        return StatefulBuilder(
          builder: (BuildContext context,setState){
            return Container(
              height: 370,
              child: bottomContent(data),
            );
          },
        );
      },
    );
4

1 回答 1

-1

使用未来的建设者,然后更新你的底表

于 2020-10-31T09:13:30.643 回答