这是我的“父级”列表的项目行,我想显示每个项目的下拉列表,但无法返回DropDownMenuItm
的对象
Container optionTile(double width,double height,int position){
return Container(
padding:EdgeInsets.only(top:width*0.03,bottom: width*0.03,left: width*0.03,right: width*0.03,),
child: Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(flex: 3,child: Text('${opAtrrList[position].groupname}',style: TextStyle(color: Colors.grey,fontFamily: 'medium'), ),),
Expanded(flex:4,child:Container(
padding:EdgeInsets.only(top:width*0.00,bottom: width*0.00,left: width*0.04,right: width*0.00,),
decoration: new BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white, width: 0.0),
//new Color.fromRGBO(255, 0, 0, 0.0),
borderRadius:
new BorderRadius.all(Radius.circular(45.0)),
), child: DropdownButton<Attribute>(
value: opAtrrList[position].attrlist[0],
items: opAtrrList[position].attrlist{}, //Here I'm uinable to set custom type of list
)),
//child: Text('$value',textAlign: TextAlign.right,style: TextStyle(color: MyColors.colorPrimary,fontFamily: 'semibold'), ),),
),
],
),
],
),
);
}
这是我的bean类
class OptionAttribute{
String _grouprowid;
String _groupname;
String _isrequired;
List<Attribute> _attrlist;
}