Flutter - setState not updating inner Stateful Widget

后端 未结 5 462
生来不讨喜
生来不讨喜 2021-02-01 02:57

Basically I am trying to make an app whose content will be updated with an async function that takes information from a website, but when I do try to set the new state, it doesn

5条回答
  •  情歌与酒
    2021-02-01 03:09

    This fixed my issue... If you have an initial value to be assigned on a variable use it in initState()

    Note : Faced this issue when I tried to set initial value inside build function.

    @override
      void initState() {
        count = widget.initialValue.length; // Initial value
        super.initState();
      }
    

提交回复
热议问题