如何在Flutter中的navigator.pop(context)之后显示小吃栏? [英] How to show snackbar after navigator.pop(context) in Flutter?

查看:705
本文介绍了如何在Flutter中的navigator.pop(context)之后显示小吃栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要关闭一个屏幕,然后打开第二个屏幕.并在第一个屏幕的第二个屏幕上显示小吃店.

We need close one screen and open second screen. And show snackbar on second screen from first screen.

我尝试使用Navigator.push,但是此屏幕已经打开,并且出现错误状态错误:流已被收听".

I tried to use Navigator.push , but this screen is already open and we have this error "Bad state: Stream has already been listened to".

推荐答案

我建议您使用Flushbar插件代替Flukebar插件,它很容易使用,并且会处理所有问题,您可以自定义它很大程度上 . Snackbar需要一个脚手架祖先才能工作,但是 Flushbar不会,它会自己处理所有多余的东西,并提供大量的炫酷功能.

Instead of Snackbar i would suggest you to use Flushbar plugin for flutter it is easy to use and it'll take care of everything and u can customize it to a great extent . Snackbar needs a scaffold ancestor to work but Flushbar doesn't and it takes care of all the extra stuff itself and provides with ton of cool features.

此处为Flushbar插件

这篇关于如何在Flutter中的navigator.pop(context)之后显示小吃栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆