gpt4 book ai didi

android - 如何隐藏 Flutter Stepper 上的继续和取消按钮

转载 作者:行者123 更新时间:2023-12-04 23:48:37 30 4
gpt4 key购买 nike

我想隐藏步进器上的继续和取消按钮
并更改为 On Enter Text Filed 以继续该步骤。
可能吗?
怎么做?
谢谢

最佳答案

我已经使用此代码来隐藏继续和取消。
首先将变量 hide 声明为 bool 并且值为 false

bool hide = false;
然后在装订器中使用 controlsBuilder。
flutter >2.6
controlsBuilder: (BuildContext ctx, ControlsDetails dtl){
return Row(
children: <Widget>[
TextButton(
onPressed: dtl.onStepContinue,
child: Text(hide == true ? '' : 'NEXT'),
),
TextButton(
onPressed: dtl.onStepCancel,
child: Text(hide == true ? '' :'CANCEL'),
),
],
);
},
对于 flutter <= 2.5
controlsBuilder: (BuildContext context, { VoidCallback? onStepContinue, VoidCallback? onStepCancel }) {
return Row(
children: <Widget>[
TextButton(
onPressed: onStepContinue,
child: Text(hide == true ? '' : 'NEXT'),
),
TextButton(
onPressed: onStepCancel,
child: Text(hide == true ? '' : 'CANCEL'),
),
],
);
},
CMIIW
谢谢,

关于android - 如何隐藏 Flutter Stepper 上的继续和取消按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71075293/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com