背景:我正在开发一个移动应用程序,在这个应用程序中,我使用WebViewScaffold加载一个在线目录。此特定目录在初次访问时提供导游服务。
问题:每次我导航到目录WebView时,巡演从一开始就开始(这会冻结用户直到巡演结束)。我怎么才能阻止这一切发生呢?在浏览器中打开目录时,浏览的状态将保存在浏览器的本地存储变量中。是否有方法保存或重置颤振中的本地存储变量?
代码:单击按钮后,我按下一条新路径,创建一个新的Directory对象,如下所示:
class MobileDirectory extends StatelessWidget {
final _mobileDirectory = 'my.mobileDirectory.url';
final _directoryTitle = new Text(
'Directory',
style: const TextStyle(
fontSize: 17.0, color: Colors.white, fontWeight: FontWeight.w400),
);
final _backgroundColor = new Color.fromRGBO(29, 140, 186, 1.0);
final _backButton = new BackButton(color: Colors.white);
final _padding = new EdgeInsets.only(left: 2.0);
final _imageAsset = new Image.asset('assets/appBar.jpg');
@override
Widget build(BuildContext context) {
return new WebviewScaffold(
appBar: new AppBar(
leading: _backButton,
centerTitle: true,
backgroundColor: _backgroundColor,
title: new Padding(
padding: _padding,
child: _directoryTitle,
),
actions: <Widget>[
_imageAsset,
],
),
url: _mobileDirectory,
);
}
}注:如需提供更多资料,请告知我。
发布于 2018-03-26 15:38:33
https://stackoverflow.com/questions/49495293
复制相似问题