[英]how to create this popu menu widget in flutter
您必须将“ExpensionTile”放入如下代码的容器中:
ExpansionTile(
title: new Text(vehicles[0].title, style: new TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, fontStyle: FontStyle.normal, color: Colors.black),),
children: <Widget>[
new Column(
children: _buildExpandableContent(vehicles[0]),
),
],
),
并调用此方法:
_buildExpandableContent(Vehicle vehicle) {
List<Widget> columnContent = [];
for (String content in vehicle.contents)
columnContent.add(
new Container(
height: 50,
child: Row(
children: <Widget>[
Container(
padding: EdgeInsets.only(left: 40, top: 0),
child: new Image.asset('assets/images/demo.png', scale: 1.5,),
),
Container(
padding: EdgeInsets.only(left: 20, top: 0),
child: new Text(content, style: new TextStyle(fontSize: 14.0, fontStyle: FontStyle.normal, color: Color(0Xff004FBA), fontWeight: FontWeight.bold),),
),
Container(
padding: EdgeInsets.only(left: 140, top: 0, bottom: 10),
child: new Text(content, style: new TextStyle(fontSize: 12.0, fontStyle: FontStyle.normal, color: Color(0Xff767676), fontWeight: FontWeight.normal,),),
)
],
),
)
);
return columnContent;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.