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 : 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM