颤音 - 如何将Snackbar定位在系统导航栏上方
我的应用程序中有一个透明的系统导航栏。
该应用程序使用GetX小吃栏来投掷错误和成功消息。我坚持的是,每当应用程序投掷小吃吧时,小吃吧都会出现并通过透明导航栏消失(我可以看到小吃栏在导航栏中移动)。有什么方法可以在导航栏上方出现小吃吧?如何将小吃栏放置在系统导航栏上方?
I have a transparent system navigation bar in my application.
Getx snack bar is used by the app to throw errors and success messages. What I'm stuck with is that anytime the app throws a snack bar, the snack bar appears and disappears through the transparent navigation bar (i can see the snack bar move through the navigation bar). Is there any way to have the snack bar appear above the navigation bar? How can I position the snack bar above the system navigation bar?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可能需要查看 snackbarbehavior 让一个人可以更改位置。如果您使用的是第三方库,则可能需要尝试将行为放入扩展方法中。在此所以问题确切的重复。
Snackbarbehavior枚举指出:
其他想法包括使用带有堆栈小部件的位置小部件来获得精确的控制。添加MediaQuery或其他分数小部件以允许多个屏幕尺寸。
You may want to look into SnackBarBehavior enum which allows one to change the position. If you are using a third party library then you may want to try putting the behavior into an extension method. Alternative ideas exist on this SO Question that may apply in your use case although not an exact duplicate.
The SnackbarBehavior enum states:
Other ideas include using a position widget with a Stack widget to gain precise control. Add a MediaQuery or other fractional widgets to allow for multiple screen sizes.
我建议您使用Flutter团队开发的Snackbar小部件,而不是GetX Snackbar。它基本上出现在此处的导航栏上方。
I suggest you to use SnackBar Widget that developed by flutter team instead of Getx snackbar. It basically appears above of navigation bar here an basic example;
在我的应用中使用这样的。工作正常。
Used like this in my app. Worked fine.
就我而言,这是我返回Show Shackbar以获取错误消息,Snackbar出现
在GetX Snackbar中Appbar下方的顶部,有一个小点心:属性
您可以使用它来显示您的
In my case, this is my return to show snackbar for error message, the snackbar appear on top below the appbar
In the getx snackbar there are a snackPosition: attribute
You can use that to display yours