问题描述
我正在使用图像(列表),就像我们的移动图库一样!第一个屏幕我有图像列表,一旦点击你可以看到全视图预览模式(如移动画廊)!你可以向左滚动,向右滚动查看照片!现在,当我们可以点击它时,它会转到另一个屏幕,但问题是当我回来时,它会转到第一个屏幕而不是第二个屏幕!我试图在上图中向您解释!你也可以看到我的代码...!我尝试了所有类型的 Navigator.pop 但什么也没发生!请尽快帮助我....
在我点击的第一个屏幕上,我将图像列表数组传递到我的第二个屏幕
setState(() {
Navigator.push(context,PageTransition(type: PageTransitionType.fade,child:CampaignSinglePhotos(
currentindex: index,ImageId: listing,images: listing,),duration: Duration(milliseconds: 500)));});
在我的第二个屏幕上:PhotoViewgallery(向左向右滑动查看图像)
Container(
child:
InkWell(
child: Center(
child: PhotoViewgallery.builder(
itemCount: widget.images.length,builder: (BuildContext context,int index) {
return PhotoViewgalleryPageOptions(
imageProvider: AdvancednetworkImage( widget.images[index].photoPreviewImagePath,usediskCache: true,maxScale: PhotoViewComputedScale.covered * 1.5,minScale: PhotoViewComputedScale.contained * 1.0,);
},pageController: PageController(initialPage: widget.currentindex,keepPage: true),enableRotation: false,scrollDirection: Axis.horizontal,onPageChanged: pageChange,)
),onTap: (){
Navigator.pushReplacement(context,PageRouteBuilder(pageBuilder: (a,b,c) =>
Download(),transitionDuration: Duration(seconds: 1),));
},)
),
这是我的第三个屏幕
return Scaffold(
body: Center(
child: InkWell(child: RaisedButton(child: Text("Please go back")),onTap: (){
Navigator.pop(context);
},);
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)