skip to Main Content

here is my code
class SettingsPage extends StatefulWidget {
const SettingsPage({Key? key}) : super(key: key);

@override
_SettingsPageState createState() => _SettingsPageState();
}

class _SettingsPageState extends State {
InAppWebViewController? webViewController;

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Settings"),
),
body: InAppWebView(
initialUrlRequest: URLRequest(
url: WebUri("https://www.google.com"), // Using WebUri directly
),
onWebViewCreated: (controller) {
webViewController = controller;
},
),
);
}
}

2

Answers


  1. Did you add the internet permission for android?

    Make sure to add the internet permission

    <?xml version="1.0" encoding="utf-8"?>
    <manifest ...>
        <uses-permission android:name="android.permission.INTERNET" />
        <application
            ...
           
               ...
        </application>
    </manifest>
    
    Login or Signup to reply.
  2. You should provide more detail like is it only happen on IOS or android but if you have this problem that web didn’t load on android device try this
    add this to dependency_override in pubspec.yaml

    webview_flutter_android: 3.16.1
    

    or you can migrate flutter_inappwebview to newer version like 6.1.5 that im just migrate today and it work perfectly but if you really want to use 6.0.0 above method is what you have to do

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search