在步进器中,我们有步骤。当我们处于一个步骤中并单击继续或下一步时,我们将移至另一步骤,是否有可能不隐藏之前转到新步骤之前的步骤?
我想开始,但是我不知道如何处理。我认为有用的可能是StepState。
只是完整项目代码的一部分,但最重要。
_addStep(
String title, List<String> meals, List<double> cost, double employerCost,
{active = true}) {
widget._controller.updateSummary(meals[0], cost[0]);
_isActive.add(active);
_listSteps.add(
Step(
title: Text(
title,
style: OrderStyles.HEADER_TEXT_STYLE,
),
isActive: _isActive.last,
content: ExpansionTileView(
ExpansionModel(
meals,
cost,
employerCost,
widget._controller.getMenuSummary().summaryMeal.length - 1,
_callBack),
),
state: StepState.indexed,
),
);
}
_setStepper() {
_stepper = Stepper(
controlsBuilder: _orderButton(),
currentStep: _stepCounter,
steps: _listSteps,
onStepTapped: (step) {
setState(() {
_stepper.steps[step].isActive
? _stepCounter = step
: _moveCounterNext();
});
},
//reserved for Order
onStepContinue: () {
setState(() {
if (_stepCounter == _listSteps.length - 1)
widget._controller.sendOrder();
});
},
);
}
我希望单击“继续”或“步骤”时,选择的步骤不会隐藏。