Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix white screen in webview_flutter?

Run webview_flutter example app(https://github.com/flutter/plugins/tree/master/packages/webview_flutter/example) with inital_url: "https://kreatryx.com" On Android it just shows white screen with Zopim chat bar on the bottom right. On iOS it runs fine. Any solution for android?

What I've already tried: 1. Flutter channel dev 2. Flutter channel master

enter image description here

like image 361
Amarjeet Singh Avatar asked Jan 10 '19 10:01

Amarjeet Singh


1 Answers

Thanks to the github Issues reference in this post, the following solution worked for me to edit Info.plist:

<key>io.flutter.embedded_views_preview</key>
<string>YES</string>
<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key> <true/>
  <key>NSAllowsArbitraryLoadsInWebContent</key> <true/>
</dict>

I am new to working with Info.plist, and wasn't sure if the <dict> tags could be nested like that, but apparently it's ok.

like image 156
Gene Bo Avatar answered Oct 05 '22 13:10

Gene Bo