How do I disable a Button in Flutter?

后端 未结 8 2166
不思量自难忘°
不思量自难忘° 2020-12-04 17:19

I\'m just starting to get the hang of Flutter, but I\'m having trouble figuring out how to set the enabled state of a button.

From the docs, it says to set onP

8条回答
  •  忘掉有多难
    2020-12-04 17:42

    Setting

    onPressed: null // disables click
    

    and

    onPressed: () => yourFunction() // enables click
    

提交回复
热议问题