Flutter showDialog无法指定宽度
2022-02-22 本文已影响0人
popesa
这是因为在Dialog内部使用了:
ConstrainedBox(
constraints: const BoxConstraints(minWidth: 280.0),
来指定最小宽度,所以如果想要自定义宽度,应该使用UnconstrainedBox来包括自定义的元素。
这是因为在Dialog内部使用了:
ConstrainedBox(
constraints: const BoxConstraints(minWidth: 280.0),
来指定最小宽度,所以如果想要自定义宽度,应该使用UnconstrainedBox来包括自定义的元素。