flutter Dialog里ListView的问题

    showDialog(
        context: context,
        builder: (ctx) {
          return

//            Dialog(
//            child: Container(
//              padding: EdgeInsets.fromLTRB(24.0, 0.0, 24.0, 0.0),
//              decoration: BoxDecoration(
//                color: Colors.transparent,
//                shape: BoxShape.rectangle,
//                borderRadius: BorderRadius.circular(20.0),
//                image: DecorationImage(
//                  repeat: ImageRepeat.repeat,
//                  image: CachedNetworkImageProvider("http://" +
//                      ServerConfig.static_url +
//                      "/xxxxx/xxx/xxxxx.jpg" +
//                      "?x-oss-process=style/phone"),
//                ),
//              ),
//              constraints: BoxConstraints.loose(Size(
//                  double.infinity, MediaQuery.of(context).size.height / 2)),
////            height: MediaQuery.of(context).size.height/2,
//              child: Center(
//                child: Container(
//                  padding: EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 5.0),
//                  decoration: BoxDecoration(
//                    color: Colors.white,
//                    shape: BoxShape.rectangle,
//                    borderRadius: BorderRadius.circular(20.0),
//                  ),
//                  child: new Form(
//                      child: new Column(
//                    mainAxisSize: MainAxisSize.min,
//                    children: <Widget>[
//                      new Flexible(
//                          child: new ListView(
//                        shrinkWrap: true,
//                        children: dialogContent,
//                      ))
//                    ],
//                  )),
//                ),
//              ),
//            ),
//          );

            new Dialog(
              child: new SingleChildScrollView(
                child: new Material(
                  child: ListBody(children: dialogContent,),
                ),
              ),
            );





        });

两种解决方式分别用了 两种颜色标记

ps : 

猜你喜欢

转载自www.cnblogs.com/LiuPan2016/p/10453867.html