简体   繁体   中英

how to create this popu menu widget in flutter

I need help in creating this type of popup window or popup menu in flutter. In which i will use ExpansionTile to show countries and cities. popup menu

You have to take 'ExpensionTile' in a container like below code:

  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]),
                  ),
                ],
            ),

And call this method:

    _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;
  }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM