chdyiboke / weekly

issue and share weekly
5 stars 1 forks source link

flutter中,自定义showDialog时 使用Material铺满全屏幕,不满足自适应 #12

Open liukexina opened 4 years ago

liukexina commented 4 years ago

解决:UnconstrainedBox:消除父级约束 type: MaterialType.card代替type: MaterialType.transparency

UnconstrainedBox( alignment: Alignment.center, child: Material( child: Center( child: Container( width: width, alignment: Alignment.center, child:child ), type: MaterialType.card, ), );