且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

仅在热重载或刷新后才显示数据

更新时间:2023-12-03 12:49:34

TLDR:如果在 then()内部调用 setState()否,它将在一切完成之前执行,并且完全没有效果.

TLDR: Call setState() from inside then() if not, it will be executed before everything completes and have no effect at all.

getUser().then((response) {
   //Your stuff

   setState(() {}); //refresh
  });