Flutter 颤振如何摆脱图标填充?
我做了所有关于Stackoverflow的解决方案 但它在水平方向上仍然有一个空间 我想把这些图标设置得非常紧密 我的密码是Flutter 颤振如何摆脱图标填充?,flutter,flutter-layout,Flutter,Flutter Layout,我做了所有关于Stackoverflow的解决方案 但它在水平方向上仍然有一个空间 我想把这些图标设置得非常紧密 我的密码是 Row( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ MediaQuery.removePadding( context: context, removeLeft:
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
MediaQuery.removePadding(
context: context,
removeLeft: true,
removeRight: true,
child: GestureDetector(
onTap: () {},
child: Container(
padding: const EdgeInsets.all(0.0),
width: 30.0,
child: IconButton(
icon: Icon(
Icons.keyboard_arrow_right,
color: Color(0xff60B906),
),
color: Color(0xff60B906),
iconSize: 30,
),
),
),
),
MediaQuery.removePadding(
context: context,
removeLeft: true,
removeRight: true,
child: GestureDetector(
onTap: () {},
child: Container(
padding: const EdgeInsets.all(0.0),
width: 30.0,
child: IconButton(
icon: Icon(
Icons.keyboard_arrow_right,
color: Color(0xff60B906),
),
color: Color(0xff60B906),
iconSize: 30,
),
),
),
),
],
),
行(
mainAxisAlignment:mainAxisAlignment.center,
儿童:[
MediaQuery.removePadding(
上下文:上下文,
removeLeft:没错,
莱特:是的,
儿童:手势检测器(
onTap:(){},
子:容器(
填充:常量边集全部(0.0),
宽度:30.0,
孩子:我的钮扣(
图标:图标(
图标。键盘\箭头\右侧,
颜色:颜色(0xff60B906),
),
颜色:颜色(0xff60B906),
iconSize:30,
),
),
),
),
MediaQuery.removePadding(
上下文:上下文,
removeLeft:没错,
莱特:是的,
儿童:手势检测器(
onTap:(){},
子:容器(
填充:常量边集全部(0.0),
宽度:30.0,
孩子:我的钮扣(
图标:图标(
图标。键盘\箭头\右侧,
颜色:颜色(0xff60B906),
),
颜色:颜色(0xff60B906),
iconSize:30,
),
),
),
),
],
),
有什么办法能解决我的问题吗
我希望它非常接近您可以使用
堆栈
小部件
示例代码
Stack(
alignment: Alignment.center,
children: <Widget>[
IconButton(
onPressed: null,
icon: Icon(
Icons.keyboard_arrow_right,
color: Color(0xff60B906),
),
color: Color(0xff60B906),
iconSize: 30,
),
Positioned(
right: 20,
child: IconButton(
onPressed: null,
icon: Icon(
Icons.keyboard_arrow_right,
color: Color(0xff60B906),
),
color: Color(0xff60B906),
iconSize: 30,
),
),
],
)
堆栈(
对齐:对齐.center,
儿童:[
图标按钮(
onPressed:null,
图标:图标(
图标。键盘\箭头\右侧,
颜色:颜色(0xff60B906),
),
颜色:颜色(0xff60B906),
iconSize:30,
),
定位(
右:20,,
孩子:我的钮扣(
onPressed:null,
图标:图标(
图标。键盘\箭头\右侧,
颜色:颜色(0xff60B906),
),
颜色:颜色(0xff60B906),
iconSize:30,
),
),
],
)
输出
如果您想实现这一目标 有两种选择 1-将其作为PNG图像下载到文件夹资产中,并使其成为子文件夹 而不是争吵
GestureDetector(
onTap: () {},
child: Image.asset(
"imagePath",
color: Color(0xff60B906),
height: 16,
width: 16,
),
),
2-如果您想将其作为图标,请将其作为SVG中的图标数据从该站点获取
并像往常一样添加图像您想要的是什么样子的now@KirillMatrosov我添加了它你只是想删除箭头之间的空间还是箭头外部的空间?@RavindraKushwaha是的,我想删除箭头之间不是填充的空间。。。这是真正的图标。。除非将它们堆叠在一起,否则无法删除它们谢谢您的回答,但它似乎也有一个空间。我希望它非常接近“>>”文本哦,你是对的,我更改了定位的值,然后它工作了谢谢!