【问题标题】:webview_flutter 3.0.0 Problem Cant Solve It ( onWebViewCreated )webview_flutter 3.0.0 问题无法解决(onWebViewCreated)
【发布时间】:2022-01-18 13:04:47
【问题描述】:

the problem

我正在使用 web view flutter 3.0.0,它不想接受任何东西(在 Web View Created 上).. .. 所以如果有人能解决,请不胜感激

【问题讨论】:

    标签: flutter webview android-webview


    【解决方案1】:
      android {
        defaultConfig {
            minSdkVersion 19
        }
    }
    Using Virtual displays 
    Set the correct minSdkVersion in android/app/build.gradle (if it was previously lower than 20):
    
     android {
         defaultConfig {
             minSdkVersion 20
         }
     }
    Set WebView.platform = AndroidWebView(); in initState(). For example:
    
     import 'dart:io';
    
     import 'package:webview_flutter/webview_flutter.dart';
    
     class WebViewExample extends StatefulWidget {
       @override
       WebViewExampleState createState() => WebViewExampleState();
     }
    
     class WebViewExampleState extends State<WebViewExample> {
       @override
       void initState() {
         super.initState();
         // Enable virtual display.
         if (Platform.isAndroid) WebView.platform = AndroidWebView();
       }
    
       @override
       Widget build(BuildContext context) {
         return WebView(
           initialUrl: 'https://flutter.dev',
         );
       }
     }
    

    【讨论】:

    • 此配置检查
    • 还是不行
    • 错误文件代码发送代码
    猜你喜欢
    • 1970-01-01
    • 2018-05-24
    • 1970-01-01
    • 2022-01-10
    • 2016-10-16
    • 2017-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多