Flutter:Inconsistently getting error: The getter 'ioRequest' isn't defined for the class 'IOClient'

755 views
Skip to first unread message

Alexander san

unread,
Feb 3, 2021, 3:30:28 PM2/3/21
to Flutter Development (flutter-dev)
Hi Flutter Community,

This problem appeared to me after implementing a search to the database, previously I had no problem, it worked well for me, but from one moment to another this problem appeared and I do not understand the problem.

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/src/io_client.dart:31:9: Error: Expected an identifier, but got '..'. ..followRedirects = request.followRedirects

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/src/io_client.dart:36:9: Error: The getter 'ioRequest' isn't defined for the class 'IOClient'. - 'IOClient' is from 'package:http/src/io_client.dart'

('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/src/io_client.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'ioRequest'. var response = await stream.pipe(ioRequest) as HttpClientResponse; FAILURE: Build failed with an exception.

Where: Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904

What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

String mensaje = ""; String urldata="https://example/api/data.php"; 

 Future<List> cargarCitas(String usuarioId, String mascotaId) async {

  var usuario = usuarioId; 

  var mascota =mascotaId; 

  var preguntaData = "4"; 

  final respuestacitas = await http.post(Uri.encodeFull(urldata), headers: {

  "Content-Type": "application/json"

}, body: { 

  "usuario": usuario, "pregunta": preguntaData, "mascota": mascota, 

 });

  if (respuestacitas.statusCode == 200) {

  final cargarDayaReserva = jsonDecode(respuestacitas.body) as List; 

  reservaMascota = cargarDayaReserva.map((e) => ReservaData.fromJson(e)).toList();      return reservaMascota; 

 } else { 

 setState(() { 

   mensaje = "cannot connect to the database"; 

 });

 } }



Suzuki Tomohiro

unread,
Feb 3, 2021, 5:19:52 PM2/3/21
to Alexander san, Flutter Development (flutter-dev)
Don’t use “^” or any other special characters when specifying dependencies. Just a version you want.

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/37bb21ed-a438-4869-816a-53f953d751cdn%40googlegroups.com.

Alexander san

unread,
Feb 3, 2021, 6:09:47 PM2/3/21
to Flutter Development (flutter-dev)

These are my dependencies in flutter, I already made the change that I indicated but there were no changes in the execution of the system, it still generates the same problem.
dependencies:
  flutter:
    sdkflutter  
  flutter_svg^0.19.0
  shimmer^1.0.1
  font_awesome_flutter^8.8.1
  http^0.12.2
  flutter_secure_storage^3.3.5
  cupertino_icons^0.1.3

Suzuki Tomohiro

unread,
Feb 3, 2021, 6:15:43 PM2/3/21
to Alexander san, Flutter Development (flutter-dev)
Once you remove ^, remove Podfile.lock and run again.

Alexander san

unread,
Feb 3, 2021, 6:41:28 PM2/3/21
to Flutter Development (flutter-dev)
..followRedirects = request.followRedirects

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/src/io_client.dart:36:9: Error: The getter 'ioRequest' isn't defined for the class 'IOClient'.
- 'IOClient' is from 'package:http/src/io_client.dart' ('/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.12.2/lib/src/io_client.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'ioRequest'.
ioRequest.headers.set(name, value);

I still don't get this error, I try running another application that I had and it works fine, but I run the one I have currently in development and nothing still comes up with this problem, I don't understand why.

Alexander san

unread,
Feb 3, 2021, 6:42:22 PM2/3/21
to Flutter Development (flutter-dev)
I have tried searching various platforms for this error and I cannot find a solution to this problem.

Suzuki Tomohiro

unread,
Feb 3, 2021, 6:48:24 PM2/3/21
to Alexander san, Flutter Development (flutter-dev)

Alexander san

unread,
Feb 3, 2021, 7:40:52 PM2/3/21
to Flutter Development (flutter-dev)

delete that file but it caused me more problems, because in that folder there are some dependencies or something important because when deleting it caused me more problems when executing. I get many more errors.

Suzuki Tomohiro

unread,
Feb 3, 2021, 8:07:36 PM2/3/21
to Alexander san, Flutter Development (flutter-dev)

Alexander san

unread,
Feb 3, 2021, 8:24:27 PM2/3/21
to Flutter Development (flutter-dev)
this is my real problem
Captura.PNG

these are the problems that appear to me when deleting the .pub-cache folder.Captura2.PNGCaptura3.PNGCaptura4.PNGCaptura5.PNG

They are more problems but I only took a screenshot of the ones I saw initially and finally

Suzuki Tomohiro

unread,
Feb 3, 2021, 8:35:42 PM2/3/21
to Alexander san, Flutter Development (flutter-dev)
The characters in the images are not recognizable. Can you paste them into gist.github.com?

Alexander san

unread,
Feb 3, 2021, 8:54:37 PM2/3/21
to Flutter Development (flutter-dev)
https://gist.github.com/zerothfull/4fd794dbb5a480c60427349acfbee2c6
here paste the problems that I have are many but I only let myself copy those

Suzuki Tomohiro

unread,
Feb 3, 2021, 9:05:34 PM2/3/21
to Alexander san, Flutter Development (flutter-dev)
I never seen these errors before. It complains Flutter’s material widgets. Did you upgrade Flutter SDK recently? Can you try reinstalling the stable SDK?

Alexander san

unread,
Feb 3, 2021, 9:09:07 PM2/3/21
to Flutter Development (flutter-dev)
There is a way that I can send you my application so that you can see the code and see if you run the same problem, please help me, I don't know what happened, it is my thesis topic to be an engineer and I am making my apk for the first time in flutter but I do not know what happened, I was just finishing making a menu for a select with query to the database and the application closed and I was presented with that problem

Alexander san

unread,
Feb 3, 2021, 9:09:42 PM2/3/21
to Flutter Development (flutter-dev)
You can send me your email to give you my file and you can see it

Alexander san

unread,
Feb 3, 2021, 9:10:05 PM2/3/21
to Flutter Development (flutter-dev)
I don't know where I was wrong

Suzuki Tomohiro

unread,
Feb 3, 2021, 9:31:14 PM2/3/21
to Alexander san, Flutter Development (flutter-dev)
Please ensure that all code you share to me is publicly available in GitHub. If you share any code to me, I might share it in this public mailing list.

By the way, you’re not answering my question: Did you upgrade Flutter SDK recently? Can you try reinstalling the stable SDK?


Alexander san

unread,
Feb 3, 2021, 9:36:02 PM2/3/21
to Flutter Development (flutter-dev)

if i recently updated the flutter.

Flutter 1.22.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 9b2d32b605 (12 days ago) • 2021-01-22 14:36:39 -0800
Engine • revision 2f0af37152
Tools • Dart 2.10.5

Suzuki Tomohiro

unread,
Feb 3, 2021, 10:24:27 PM2/3/21
to Alexander san, Flutter Development (flutter-dev)
I don’t install apk. Can you reinstall Flutter SDK and ensure an empty project works fine?


> Hello friend, here is my apk in github, you can review it and see where I was wrong.

Alexander san

unread,
Feb 3, 2021, 10:29:32 PM2/3/21
to Flutter Development (flutter-dev)
If I already reinstall the flutter sdk again it runs a new project and it works fine, but I start my project and it continues the same, I change all the files to a new project and then I install the dependencies and the same problem occurs I do not understand why.

Alexander san

unread,
Feb 3, 2021, 10:30:27 PM2/3/21
to Flutter Development (flutter-dev)
Thank you very much for your help and for your time, I really don't understand why it is generated even if I start a new project but I'm rewriting the code to see what happens.
Reply all
Reply to author
Forward
0 new messages