Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: DioError [DioErrorType.DEFAULT]: RangeError (index): Invalid value: Only valid value is 0:

I am getting this error in dio library while calling local API

Flutter: DioError [DioErrorType.DEFAULT]: RangeError (index): Invalid value: Only valid value is 0:
like image 642
Ankit Mahadik Avatar asked Jan 24 '23 09:01

Ankit Mahadik


1 Answers

Causing issue:-

My base url is without http:// or https// causing the issue 10.0.2.2:4003/api/v1/

Worked for me :-

I only added http:// in URL http://10.0.2.2:4003/api/v1/

you can use https// instead of http//

like image 170
Ankit Mahadik Avatar answered May 12 '23 10:05

Ankit Mahadik