2

This is my item row of Parent list and I want to show dropdown at every item, but unable to return the object of 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'), ),),
                ),
              ],
            ),
          ],
        ),
      );
    }

here is my bean class

class OptionAttribute{

  String _grouprowid;
  String _groupname;
  String _isrequired;
  List<Attribute> _attrlist;
  }

I want Attribute list inside dropdown. I tried this and this but how can I set dynamic list inside drop down.

Farhana Naaz Ansari
  • 7,524
  • 26
  • 65
  • 105

0 Answers0