颤振-空白显示纵向和横向图像

时间:2020-10-21 13:22:13

标签: flutter dart flutter-layout flutter-dependencies singlechildscrollview

如果我在图像中进行横向或纵向操作,我会不断看到很多空白。我确实需要可滑动的,所以不想过多地调整代码,但我确实希望它看起来可表示

我的代码有问题吗?

我确实添加了在横向和纵向模式下都发生的图片

[1]: https://i.stack.imgur.com/Rx8Gs.jpg

portrait image @override 小部件build(BuildContext context){ 返回脚手架( appBar:AppBar( 标题:新文本( “ 1 Alif-laam-meemآلم,Pg2”, 样式:新的TextStyle(颜色:styling.appBarTextcolor), ), 领先:新的IconButton( 图标:新Icon(styling.appBarBackArrowIcon), onPressed:(){ Navigator.push( 上下文 MaterialPageRoute( builder :(上下文)=> NavDrawer(), )); })), 正文:LayoutBuilder(生成器: (BuildContext上下文,BoxConstraints viewportConstraints){ 返回SingleChildScrollView( 孩子:堆栈(孩子:[ 新滑动式( 委托:new SlidableDrawerDelegate(), actionExtentRatio:styling.sizeofenglishandforward, 子代:SafeArea( top:是的, 下:真, 正确:是的, 左:对, 子代:新容器( 子:new Image.asset( “ test / assets / Para 1-Alif-laam-meem no color / quranpg2-1.png”, // fit:BoxFit.fitidth, 适合:BoxFit.cover, ), ), ), 动作:[ 新的IconSlideAction( 标题:styling.englishIconText, 颜色:styling.englishIconColorstripe, 图标:styling.englishIcon, 前景色:styling.englishIconColor, onTap:(){ Navigator.push( 上下文 MaterialPageRoute( 生成器:(上下文)=> Changepg2topg2Color()), ); }), 新的IconSlideAction( 标题:styling.forwardIconText, 颜色:styling.forwardIconColorstripe, 图标:styling.forwardIcon, 前景色:styling.forwardIconColor, // onTap:(){ // Navigator.push( //上下文 // MaterialPageRoute(builder:(context)=> Changepg2topg3()), //); //} ), //), ], secondaryActions:[ 新的IconSlideAction( 标题:styling.backIconText, 颜色:styling.backIconColorstripe, 图标:styling.backIcon, 前景色:styling.backIconColor, // onTap:()=> _showSnackBar('More'), ), 新的IconSlideAction( 标题:styling.arabicIconText, 颜色:styling.arabicIconColorstripe, 图标:styling.arabicIcon, 前景色:styling.arabicIconColor, // onTap:()=> ), ], ), ])); })); } }

1 个答案:

答案 0 :(得分:1)

SafeArea阻止您的图像进入屏幕的某些受限区域,例如陷波区域下方。或者对于某些设备,屏幕底部有NavigationKeys。尝试删除这些

干杯:)

child: SafeArea(
            top: true,
            bottom: true,
            right: true,
            left: true,
相关问题