-3

enter image description here

This is what I get when I try to login to my application using an api. Please check the screenshot of my error.

[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform:(url of the api)
Mr.1003
  • 1
  • 1
  • Check this [question](https://stackoverflow.com/questions/64197752/bad-state-insecure-http-is-not-allowed-by-platform), maybe a duplicate one. – Pathik Patel Apr 28 '21 at 10:12

1 Answers1

0

Add this Into Your Manifest:

  android:usesCleartextTraffic="true"

Example:

<application
        android:usesCleartextTraffic="true"
        android:name=".MainApplication"
        android:label="@string/app_name"
        android:icon="@mipmap/ic_launcher"
        android:allowBackup="false"
        android:theme="@style/AppTheme">
</application>