Home > Software engineering >  Webview issue for demo URL in flutter
Webview issue for demo URL in flutter

Time:12-28

I am using webview_flutter for open URL initialUrl: https://demo.MyFatoorah.com not working but initialUrl: https://MyFatoorah.com working. Please let me know what the problem in demo url.

CodePudding user response:

->Use This Code

  import 'package:webview_flutter/webview_flutter.dart';
    
    WebView(
                      initialUrl:"https://demo.myfatoorah.com/En/All/Account/LogIn",
                      javascriptMode: JavascriptMode.unrestricted,
                       
                      },
                    ),

CodePudding user response:

I didn't think there is any issue with your url. We can't tell you what is issue in your code without your code.

Try this Snippet I have checked and it's working fine in my device

Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        backgroundColor: Colors.white,
        elevation: 0,
      ),
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: SizedBox(
          height: double.infinity,
          width: double.infinity,
          child: IndexedStack(
            index: pos,
            children: <Widget>[
              WebView(
                zoomEnabled: true,
                initialUrl: "https://demo.MyFatoorah.com",
                javascriptMode: JavascriptMode.unrestricted,
                onPageStarted: (value) {
                  setState(() {
                    pos = 1;
                  });
                },
                onPageFinished: (value) {
                  setState(() {
                    pos = 0;
                  });
                },
              ),
              const Center(child: CircularProgressIndicator()),
            ],
          ),
        ),
      ),
    );
  • Related