Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform in Flutter Application

Опубликовано: 25 Март 2026
на канале: Techno BD XYZ
1,177
24

Flutter Solution -

Problem : --
Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://115.130.58.88/API/Login
E/flutter ( 7011): #0 _HttpClient._openUrl (dart:_http/http_impl.dart:2434:7)
……..
……….


Solution : -
1. For Android:

Just add in 'android/app/src/main/AndroidManifest.xml'
" uses-permission android:name="android.permission.INTERNET"

android:usesCleartextTraffic="true"

2. For iOS:
You can add this to your ios/Runner/info.plist under the main dictionary definition:
"NSAppTransportSecurity",
"NSAllowsArbitraryLoads"
true