Sandeep Sharma
Sandeep Sharma

Reputation: 705

How to open localhost in flutter webview

What I m trying:

Open a local host in flutter WebView. I am using This plugin and this project is running in Django with URL: http://127.0.0.1:8000/. I want to open this in my flutter app.

What I have tried:

After searching SO answers, URL: http://myIPaddress:8000/.

UPDATE

I am providing internet from mobile.

This is my local IP address

I am using http://192.168.43.55:8080/ is not working and also http://192.168.43.1:8080/

Any suggestion will work, thanks.

Upvotes: 7

Views: 7807

Answers (2)

Shahrukh Azeem
Shahrukh Azeem

Reputation: 325

With Android emulator, you can access the localhost by providing the IPv4 with http:// that means http://192.168.43.55:8080/ should be accessible from your flutter webview application.

Upvotes: 0

faithomotoso
faithomotoso

Reputation: 454

Try with http://10.0.2.2:8000. If you get a cleartext error, in your AndroidManifest.xml add android:usesCleartextTraffic="true" under the application tag

Upvotes: 8

Related Questions