Flutter WebView Plugin - 如何处理本地存储变量

Flutter WebView Plugin - How To Handle Local Storage Variables

背景:我正在开发一个移动应用程序,我在其中使用 WebViewScaffold 加载在线目录。这个特定的目录在初次访问时提供了导览。

问题:每次我导航到 WebView 目录时,浏览都从头开始(这会冻结用户,直到浏览完成)。我怎样才能避免这种情况发生?当我在浏览器中打开目录时,游览的状态保存在浏览器的本地存储变量中。有没有办法在 flutter 中保存或重置本地存储变量?

代码:单击按钮后,我推送一条新路由,在其中创建一个新的目录对象,如下所示:

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,
    );
  }
}

注意:如果需要提供更多信息,请告诉我。

最新版本0.1.4支持使用localstorage

https://github.com/dart-flitter/flutter_webview_plugin/blob/9873b2d9a2167f76018d4f6e7fc6e2a1ed8ce5c9/lib/src/webview_scaffold.dart#L35