我的应用在其顶部区域有一个搜索栏。有带有特殊切口的设备。为了将应用程序扩展到真正的全屏,我添加到<app_name>\android\app\src\main\AndroidManifest.xml
:
<style name="ActivityTheme">
<item name="android:windowLayoutInDisplayCutoutMode">
shortEdges
</item>
</style>
这很好用。然而,下一步显然是识别剪切位置,并相应地放置搜索栏:
提到的文档是指一种JAVA
方法WindowInsets.getDisplayCutout()
。我想知道是否有等价的flutter
或包装它的插件。