Flutter InAppWebview with basic authenication

Plugin: InAppWebview

InAppWebView(
    initialUrlRequest:
        URLRequest(url: Uri.parse('https://${your_url}')),
    initialOptions: InAppWebViewGroupOptions(
        crossPlatform: InAppWebViewOptions(),
        android: AndroidInAppWebViewOptions(
        useHybridComposition: true,
        ),
        ios: IOSInAppWebViewOptions(
        allowsInlineMediaPlayback: true,
        ),
    ),
    onWebViewCreated: (InAppWebViewController controller) {

    },
    onLoadStart: (controller, url) {

    },
    onLoadStop: (controller, url) async {

    },
    onProgressChanged:
        (InAppWebViewController controller, int progress) {
    },
    onReceivedHttpAuthRequest: (controller, challenge) async {
        // BASIC AUTHENICATION ACCOUNT
        return HttpAuthResponse(
            username: "username",
            password: "password",
            action: HttpAuthResponseAction.PROCEED);
    },
),

Comments !

Links

Social