Issue
I wanna hide Continue and Cancel Button on Stepper And change to On Enter Text Filed for continuing the step. Is it possible? How to do that?
Thanks
Solution
I have already used this code for hiding Continue and Cancel.
Firt declare variable hide as bool and the value is false
bool hide = false;
Then use controlsBuilder in the stapper.
For 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'),
),
],
);
},
And for 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
Thanks,
Answered By - Mr. AinLamQaf
Answer Checked By - Candace Johnson (JavaFixing Volunteer)