Android 步进机自定义按钮设计
我正在我的颤振应用程序中实现步进。我被困在一个需要继续设计和取消/返回按钮自定义设计的位置。我如何尝试确定如何实现我的定制设计 我找到了为步进机设计自定义按钮的解决方案。它可以通过controlsBuilder实现。以下是我的示例代码:Android 步进机自定义按钮设计,android,flutter,dart,hybrid-mobile-app,flutter-layout,Android,Flutter,Dart,Hybrid Mobile App,Flutter Layout,我正在我的颤振应用程序中实现步进。我被困在一个需要继续设计和取消/返回按钮自定义设计的位置。我如何尝试确定如何实现我的定制设计 我找到了为步进机设计自定义按钮的解决方案。它可以通过controlsBuilder实现。以下是我的示例代码: controlsBuilder: (BuildContext context, {VoidCallback onStepContinue, VoidCallback onStepCancel}) { ret
controlsBuilder: (BuildContext context, {VoidCallback onStepContinue, VoidCallback onStepCancel}) {
return Column(
children: <Widget>[
SizedBox(height: AppSize.smallMedium,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ProgressButtonWidget(
backgroundColor: Colors.lightBlueAccent,
buttonTitle: Constants.continueButton,
tapCallback: (){
setState(() {
// update the variable handling the current step value
// going back one step i.e adding 1, until its the length of the step
if (currentStep < mySteps.length - 1) {
currentStep = currentStep + 1;
} else {
currentStep = 0;
}
});
},
),
SizedBox(width: AppSize.small,),
ProgressButtonWidget(
backgroundColor: Colors.grey,
buttonTitle: Constants.cancelButton,
tapCallback: (){
// On hitting cancel button, change the state
setState(() {
// update the variable handling the current step value
// going back one step i.e subtracting 1, until its 0
if (currentStep > 0) {
currentStep = currentStep - 1;
} else {
currentStep = 0;
}
});
},
),
],
),
SizedBox(height: AppSize.smallMedium,),
],
);
我找到了为步进机设计定制按钮的解决方案。它可以通过controlsBuilder实现。以下是我的示例代码:
controlsBuilder: (BuildContext context, {VoidCallback onStepContinue, VoidCallback onStepCancel}) {
return Column(
children: <Widget>[
SizedBox(height: AppSize.smallMedium,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ProgressButtonWidget(
backgroundColor: Colors.lightBlueAccent,
buttonTitle: Constants.continueButton,
tapCallback: (){
setState(() {
// update the variable handling the current step value
// going back one step i.e adding 1, until its the length of the step
if (currentStep < mySteps.length - 1) {
currentStep = currentStep + 1;
} else {
currentStep = 0;
}
});
},
),
SizedBox(width: AppSize.small,),
ProgressButtonWidget(
backgroundColor: Colors.grey,
buttonTitle: Constants.cancelButton,
tapCallback: (){
// On hitting cancel button, change the state
setState(() {
// update the variable handling the current step value
// going back one step i.e subtracting 1, until its 0
if (currentStep > 0) {
currentStep = currentStep - 1;
} else {
currentStep = 0;
}
});
},
),
],
),
SizedBox(height: AppSize.smallMedium,),
],
);
发布你的controlsBuilder属性我现在找到了你与controlBuilder提到的解决方案。发布你的controlsBuilder属性我现在找到了你与controlBuilder提到的解决方案。生活品味,感谢你的回答生活品味,感谢你的回答