There could be many reasons why this error happens. One of the error is due to wrong SSL which means https or no http.
If you are on local host in that case if you use https with base url, the you will get Futter Dio HandshakeException: Connection terminated during handshake
You see, locally I have used https. That’s wrong. That’s why I got the above error. Remove that and the error would be gone.
If you really want to use https local then try ngrok as proxy server.