Flutter 带有图像抖动的AppBar标题
我有附加的AppBar,我想在标题旁边添加一个图像,而不是动作图标,只有图像,我如何处理这个 appBar:appBar 标题:文本“标题”, 行动:[ 新图标按钮 图标:新建IconIcons.refresh, 按下按钮:{ 设定状态 { widget.athkarcontegory.reset; }, ; }, , ], , AppBar的title属性接受一个小部件,这意味着它们的任意组合 例如,如果你想在标题旁边有一个图像,你可以简单地将它包装在一个行小部件中,然后将图像添加到包含标题的文本旁边 下面是您试图完成的代码示例: 相关代码部分如下所示: appBar:appBar 标题:世界其他地区 儿童:[ Textwidget.title, Image.networkhttps://i.ytimg.com/vi/Uk1RPEQI8mI/maxresdefault.jpg,宽:50,高:50 ], , , AppBar的title属性接受一个小部件,这意味着它们的任意组合 例如,如果你想在标题旁边有一个图像,你可以简单地将它包装在一个行小部件中,然后将图像添加到包含标题的文本旁边 下面是您试图完成的代码示例: 相关代码部分如下所示: appBar:appBar 标题:世界其他地区 儿童:[ Textwidget.title, Image.networkhttps://i.ytimg.com/vi/Uk1RPEQI8mI/maxresdefault.jpg,宽:50,高:50 ], , ,Flutter 带有图像抖动的AppBar标题,flutter,dart,appbar,Flutter,Dart,Appbar,我有附加的AppBar,我想在标题旁边添加一个图像,而不是动作图标,只有图像,我如何处理这个 appBar:appBar 标题:文本“标题”, 行动:[ 新图标按钮 图标:新建IconIcons.refresh, 按下按钮:{ 设定状态 { widget.athkarcontegory.reset; }, ; }, , ], , AppBar的title属性接受一个小部件,这意味着它们的任意组合 例如,如果你想在标题旁边有一个图像,你可以简单地将它包装在一个行小部件中,然后将图像添加到包含标题的
AppBar标题包含一个小部件。因此,您可以按自己的方式自定义应用程序栏标题 例如: 导航栏 标题:集装箱 孩子:排 儿童:[ 文本“带图像的标题”, IconIcons.refresh, ], , ,
AppBar标题包含一个小部件。因此,您可以按自己的方式自定义应用程序栏标题 例如: 导航栏 标题:集装箱 孩子:排 儿童:[ 文本“带图像的标题”, IconIcons.refresh, ], , , 您可以使用以下选项:
AppBar(
leading: IconButton(
icon: Icon(
Icons.arrow_back,
color: Color(0xff6D6E70),
),
onPressed: () {
Navigator.pop(context);
},
),
title: Row(children: <Widget> [
Text(
"Title".toUpperCase(),
style: TextStyle(
color: Color(0xff6D6E70),
),
),
Icon(Icons.save),
]),
actions: <Widget>[
Center(
child: Wrap(
spacing: 4,
children: <Widget>[
Icon(
Icons.satellite, //Refresh Icon
),
Container(
padding: const EdgeInsets.only(right: 10),
margin: const EdgeInsets.only(top: 2.5),
child: Text(
"25",
),
) //This container is to add further text like showing an icon and then showing test
],
),
)
],
),
您可以使用以下选项:
AppBar(
leading: IconButton(
icon: Icon(
Icons.arrow_back,
color: Color(0xff6D6E70),
),
onPressed: () {
Navigator.pop(context);
},
),
title: Row(children: <Widget> [
Text(
"Title".toUpperCase(),
style: TextStyle(
color: Color(0xff6D6E70),
),
),
Icon(Icons.save),
]),
actions: <Widget>[
Center(
child: Wrap(
spacing: 4,
children: <Widget>[
Icon(
Icons.satellite, //Refresh Icon
),
Container(
padding: const EdgeInsets.only(right: 10),
margin: const EdgeInsets.only(top: 2.5),
child: Text(
"25",
),
) //This container is to add further text like showing an icon and then showing test
],
),
)
],
),
也可以使用前导
也可以使用前导
要使图像可操作吗?请将行用作标题的小部件。要获得所需的布局,请将文本和图像小部件作为子对象传递给行。要使图像可操作吗?请将行作为小部件作为标题。要获得所需的布局,请将文本和图像小部件作为子对象传递给Row。谢谢,这正是我想要的want@Huda如果要居中对齐,还需要在行中添加mainAxisAlignment:mainAxisAlignment.center。谢谢,这正是我想要的want@Huda如果要居中对齐,还需要在行中添加mainAxisAlignment:mainAxisAlignment.center。