I make a http request in my flutter app with a simple url api:
Future<http.Response> getUsers() async {
try {
return await http
.get('https://reqres.in/api/users')
.timeout(const Duration(seconds: 10))
.catchError((e) {
print("=> catchError getUsers $e");
return null;
});
} on SocketException catch (e) {
print("=> catch SocketException getUsers $e");
return null;
} catch (e) {
print("=> catch getUsers $e");
return null;
}
}
And the error message is:
err FormatException: Scheme not starting with alphabetic character (at character 1) https://reqres.in/api/users ^
I have switched to different channels of the flutter version and I don't know the solution, thanks!
Try using