【问题标题】:Can not pass the string widget to webview_flutter无法将字符串小部件传递给 webview_flutter
【发布时间】:2022-01-07 22:03:52
【问题描述】:

我无法传递作为字符串的小部件 webDon。我该如何解决?谢谢

【问题讨论】:

  • 显示什么错误?

标签: flutter variables widget


【解决方案1】:

只需删除 const。因为您的 displayText 不是 const。试试这个..

return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: SafeArea(
        child: Scaffold(
          body: WebView(
            initialUrl: displayText,
            javascriptMode: JavascriptMode.unrestricted,
          ),
        ),
      ),
    );

【讨论】:

    猜你喜欢
    • 2021-05-01
    • 1970-01-01
    • 2020-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-19
    • 1970-01-01
    相关资源
    最近更新 更多