Android 为按钮分配唯一id

Android 为按钮分配唯一id,android,button,dart,flutter,boolean,Android,Button,Dart,Flutter,Boolean,假设存在一个表单并有两个按钮,我希望一个按钮被禁用,直到用户填写完所有参数,而另一个按钮被启用,以便用户导航到后面板。是否存在为按钮分配唯一id的功能 Edit1: Tried to disable one of the button,until all the text-form field in the page is touched by users,once user enters all the required parameters ,then the button gets en

假设存在一个表单并有两个按钮,我希望一个按钮被禁用,直到用户填写完所有参数,而另一个按钮被启用,以便用户导航到后面板。是否存在为按钮分配唯一id的功能

Edit1:  Tried to disable one of the button,until all the text-form field in the page is touched by users,once user enters all the required parameters ,then the button gets enabled!

你不需要一个唯一的id

FlatButton(Text('foo'), onPressed: areAllParametersFilled ? _onFooPressed : null),
FlatButton(Text('bar'), onPressed: !areAllParametersFilled ? _onBarPressed : null),

那只是一个虚构的名字。你需要自己完成。因为你没有提供你的代码,我不知道什么适合你的需要。我假设布尔区域参数已填充;当全部填充时,该值设置为true,否则设置为false。你需要自己设置。