Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it a problem that the Dio library cannot be viewed using the Networks view in Flutter's devtools to view the requests made by Dio? #2326

Open
xhc-code opened this issue Nov 11, 2024 · 5 comments
Labels
h: need triage This issue needs to be categorized s: bug Something isn't working

Comments

@xhc-code
Copy link

xhc-code commented Nov 11, 2024

Package

dio

Version

dio: ^5.4.3+1

Operating-System

Android

Adapter

Default Dio

Output of flutter doctor -v

• Flutter version 3.24.3 on channel stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (9 weeks ago), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3

[✓] Windows Version (Installed version of Windows is version 10 or higher)

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Platform android-35, build-tools 35.0.0
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
    • All Android licenses accepted.

[✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.11.5)
    • Visual Studio Community 2022 version 17.11.35327.3
    • Windows 10 SDK version 10.0.22621.0

[✓] Network resources
    • All expected network resources are available.

Dart Version

3.5.3

Steps to Reproduce

image
image

The HTTP interface requests sent cannot be displayed and are all displayed as sockets.

Expected Result

Actual display of the request address and parameter information of the interface

Actual Result

Cannot display the true information of the request sent.


In the issue of devtool, many people have also encountered such problems, and the final conclusion is that Dio may not have used the basic request library provided by Flutter, which resulted in devtool being unable to capture requests sent through Dio.
flutter/devtools#8518

@xhc-code xhc-code added h: need triage This issue needs to be categorized s: bug Something isn't working labels Nov 11, 2024
@AlexV525
Copy link
Member

Are you using native_dio_adapter?

@xhc-code
Copy link
Author

xhc-code commented Nov 11, 2024

Are you using native_dio_adapter?

indeterminacy,But the httpClientAdapter parameter is not configured

@AlexV525
Copy link
Member

Could you write a minimal reproducible example?

@xhc-code
Copy link
Author

好的。

@xhc-code
Copy link
Author

xhc-code commented Nov 12, 2024

https://github.com/xhc-code/my_flutter_network_problem.git
image

The code here includes both HTTP and sockets when using Dio to request linked data. Moreover, the number of socket and get requests is not equal.

The code in the project has not been fully reproduced (only socket requests appear), and there may be additional configurations for the Dio in the project, but I need to check again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
h: need triage This issue needs to be categorized s: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants