如何使 Flutter Stepper 主体展开以填满整个屏幕高度

How to make Flutter Stepper body expand to fill entire screen height

因为Flutter Stepper是可滚动的,所以不能设置步进内容填满它的高度

我想做这样的布局

当我得到这个布局时

我使用了固定高度的 SizedBox,但是当屏幕具有不同的高度值时,这是不正确的方式。

您可以使用 SizedBox ,只需指定一个 non-fixed 高度并通过

获取当前屏幕高度

媒体查询。的(上下文)。尺寸。身高

无论屏幕大小如何,这都是正常工作的方式

Step(
  isActive: currentStep >=0,
  title: Text('Account'),
  content: SizedBox(
    height: MediaQuery. of(context). size. height - 300,
    child: Text("sdf"),),
),