我想将两个图标并排放置在ListTile的“尾随”侧。我尝试添加带有两个图标的Row小部件,但是它完全弄乱了整个ListTile的布局,使其无法使用。有什么方法可以扩展为尾部分配的空间吗?
这是代码:
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Welcome to Flutter',
home: Scaffold(
appBar: AppBar(
title: Text('Welcome to Flutter'),
),
body: ListView(
children: <Widget>[
ListTile(
leading: Icon(Icons.play_arrow,),
title: Text("This is a title"),
subtitle: Text("This is subtitle"),
trailing: Row(
children: <Widget>[
Icon(Icons.flight),
Icon(Icons.flight_land)
]),
)
]
),
),
);
}
}
Run Code Online (Sandbox Code Playgroud)
它是这样的:

我在flutter中做一个包含产品的应用,我需要做的是能够增加并获取要存储的增加产品的密钥,目前它们都在增加。
我留下了图片和我的代码,感谢您的帮助
Widget _buildSearchResults() {
return new ListView.builder(
itemCount: _productSearchResult.length,
itemBuilder: (context, i) {
return new Card(
child: Column(
children: <Widget>[
ExpansionTile(
leading: new CircleAvatar(
backgroundImage: new NetworkImage(_productSearchResult[i].image_url),
),
title: new Text(
'${_productSearchResult[i].name} \nPrecio: Q${_productSearchResult[i].price} / Medida: ${_productSearchResult[i].unit } ',
),
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
new Container(
child: new IconButton(
icon: new Icon(Icons.remove),
highlightColor: Colors.green,
onPressed: (){
_removeProduct();
},
),
),
new Container(
child: new Text('$_counter',
style: Theme.of(context).textTheme.display1,),
),
new Container(
child: new IconButton(
icon: new …Run Code Online (Sandbox Code Playgroud)