【发布时间】:2019-03-22 09:48:16
【问题描述】:
我有问题, 我在listView中有一个Stepper却连scolled都打不开,试了三天,还是没有结果,为什么会出现这种情况,如何解决?
有人可以帮我解决这个问题吗?
这是我的代码,
new ListView( padding: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 3.0), children: <Widget>[
new ListTile(
title: new Text(
"Day 1",
style: new TextStyle(fontSize: 20.0, color: Colors.lightGreen, fontWeight: FontWeight.bold,fontFamily: 'GoogleSans'),
),
subtitle: new Stepper(
currentStep: this._currentStep1,
onStepTapped: (step){
setState(() {
this._currentStep1 = step;
});
},
onStepContinue: (){
setState(() {
if(this._currentStep1 < 4){
this._currentStep1 += 1;
} else {
//logika jika komplit
}
});
},
onStepCancel: (){
setState(() {
if(this._currentStep1 > 0){
this._currentStep1 -= 1;
} else {
this._currentStep1 = 0;
}
});
},
steps: [
Step(
title: new Text("arrived in bali.",style: new TextStyle(fontSize: 16.0, color: Colors.black87, fontWeight: FontWeight.bold,fontFamily: 'GoogleSans')),
content: new Text("to register please show your QR code on the attendance menu. when it arrived at the venue to the admin.",style: new TextStyle(fontSize: 14.0, color: Colors.grey,fontFamily: 'GoogleSans')),
isActive: _currentStep1 >= 0
),
Step(
title: new Text("arrived in hotel bali.",style: new TextStyle(fontSize: 16.0, color: Colors.black87, fontWeight: FontWeight.bold,fontFamily: 'GoogleSans')),
content: new Text("to book a room when it arrives at the hotel, show your QR code to the hotel admin to scan it.",style: new TextStyle(fontSize: 14.0, color: Colors.grey,fontFamily: 'GoogleSans')),
isActive: _currentStep1 >= 2
),
Step(
title: new Text("Step 3"),
content: new TextField(),
isActive: _currentStep1 >= 3
),
Step(
title: new Text("Step 4"),
content: new TextField(),
isActive: _currentStep1 >= 4
),
Step(
title: new Text("Step 5 "),
content: new TextField(),
isActive: _currentStep1 >= 5
)
],
),
), ], ),
谢谢大家的回答, 最好的尊重。
【问题讨论】:
-
有什么问题,似乎对我有用。我可以滚动,并且步骤操作也可以工作。
-
你能分享你的代码吗,我哪里错了?
标签: dart flutter flutter-layout