首页 > 其他分享 >Flutter statecontroller.update(MaterialState.disabled,false)无效

Flutter statecontroller.update(MaterialState.disabled,false)无效

时间:2022-12-25 09:33:05浏览次数:40  
标签:MaterialState statecontroller update statesController disabled false

因为中间会调用

 void initStatesController() {
    if (widget.statesController == null) {
      internalStatesController = MaterialStatesController();
    }
    statesController.update(MaterialState.disabled, !widget.enabled);
    statesController.addListener(handleStatesControllerChange);
  }

  也就是说,传的值其实被覆盖了

标签:MaterialState,statecontroller,update,statesController,disabled,false
From: https://www.cnblogs.com/shitanlaozu/p/17003678.html

相关文章