首页 > 解决方案 > Flutter webview goback()不起作用

问题描述

当用户(Android)使用系统本身的后退按钮时,我想回到 webview 的上一页。我在 webview flutter by back button device 中找到了 goback 的教程,但是当我实现它并单击后退按钮时,会弹出此错误:

Exception has occurred.
NoSuchMethodError (NoSuchMethodError: The method 'goBack' was called on null.
Receiver: null
Tried calling: goBack())

知道如何解决吗?

标签: androidflutterdartwebview

解决方案


推荐阅读