我得到了这样的异常:在不包含MediaQuery的上下文中调用MediaQuery.of。], ),}
return MediaQuery.of═══
I/flutter ( 6765): The following assertion was thrown building MyApp(dirty)
我找到了一些关于在flutter中计算高度的主题,但没有一个回答我的问题。我正在尝试计算颤动中的100% of device height。我假设,我必须从MediaQuery.of().size.height中减去两件事。第一个是AppBar高度,所以我通过创建变量appBar和获取属性preferredSize.height来计算它。第二个是appBar上面的工具栏(它包含电池状态、通知等内容)。(ctx).size.height -
Medi