如何解决TransformerPageController 不工作当我在颤动中从 AwesomeSlide 控制它时
当我尝试从很棒的幻灯片控制 TransformerPageView 时,它不起作用。同时,TransformerPageView 在滑动时不起作用。如果我从 TransformerPageView 中删除控制器,则 TransformerPageView 工作正常
TransformerPageController 控制器 = TransformerPageController();
TransformerPageView(
//
loop: false,onPageChanged: (index) {
control.chnage1(index.toDouble());
// setState(() { });
valuess = index;
// moveWidget(index);
// _currentIndex = index;
},pageController: controller,transformer: DeepthPageTransformer(),itemBuilder: (BuildContext context,int index) {
return Stack(
children: [
Container(
child: Center(
child: Padding(
padding:
const EdgeInsets.only(bottom: 40.0),child: Column(
mainAxisAlignment:
MainAxisAlignment.center,crossAxisAlignment:
CrossAxisAlignment.start,children: [
Stack(
children: [
Padding(
padding:
EdgeInsets.only(top: 5.0),child: Hero(
tag: 'hero1',child: Center(
child: Container(
decoration:
BoxDecoration(),// color:Colors.deepOrange,child: Column(
// alignment: Alignment.center,children: [
Align(
alignment: Alignment
.center,child: SizedBox(
height: 200,width: 200,child: control
.counter1
.value ==
0.0
? Container()
: Image
.asset(
Constants.levelImages[control
.counter1
.value
.toInt()],)),),Padding(
padding:
const EdgeInsets
.all(12.0),child: Align(
alignment:
Alignment
.center,child: Text(
Constants
.levelname[
control
.counter1
.value
.toInt()],textAlign:
TextAlign
.center,style: TextStyle(
color: Colors
.white,fontSize:
15),],);
},itemCount: 6,AwesomeSlide(
activeLineStroke: 1,value: control.counter1.value,min: 0,max: 5,thumbSize: 110.0,inactiveLineColor: Colors.white,activeLineColor: Colors.white,child: Material(
type: MaterialType.card,color: Colors.transparent,child: Image.asset("assets/images/SliderTop.png"),onChanged: (value) {
print("value print $value");
controller.animateToPage(value.toInt(),duration: Duration(milliseconds: 400),curve: Curves.bounceInOut);
setState(() {});
moveWidget(value.toInt());
// setState(() { });
}),
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。