How to render a local HTML file with flutter dart webview

后端 未结 8 1990
孤城傲影
孤城傲影 2020-12-02 18:48

I want to render a local HTML file stored in my phone memory in webview using flutter and dart.

8条回答
  •  情话喂你
    2020-12-02 19:20

        Use webviewPlus---->
        
             dependencies:
              webview_flutter_plus: ^0.1.1+10
        
        
             add traffic on android >> app >> src >> main >> AndroidManifest.xml 
            
            
        
        
            Take these permission also on this Manifest file -------->
                
                
                
        
        update ios info.plist----->
        
        location-----------------> ios/Runner/Info.plist
        NSAppTransportSecurity
          
            NSAllowsArbitraryLoads 
          
        io.flutter.embedded_views_preview  
    
    
    Code like this
    WebViewPlus(
        javascriptMode: JavascriptMode.unrestricted,
        onWebViewCreated: (controller) {
          controller.loadString(r"""
               
                hello world
               
          """);
        },
      )
    

提交回复
热议问题