Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to inspect network calls in flutter application

Tags:

flutter

dart

I'm making network calls in flutter by using HTTP package, i want to know which type of response is getting for those calls

like image 209
krishnaji Avatar asked Aug 31 '19 04:08

krishnaji


People also ask

How do you log HTTP request and response in flutter?

Now go ahead and use this http object as you would normally do. var response = await http. get('https://jsonplaceholder.typicode.com/posts/'); It will print out all the headers, request body, response, and error in a proper format that is easy to read and looks pretty.

What is dart DevTools?

Dart DevTools is a suite of debugging and performance tools for Dart and Flutter. These tools are distributed as part of the dart tool and interact with tools such as IDEs, dart run , and webdev . The following table shows which tools you can use with common Dart app types. Flutter mobile or desktop. Flutter web.


1 Answers

Use flutter_stetho dart package to inspect network calls

Visit https://pub.dev/packages/flutter_stetho

Include this to your package's pubspec.yaml

dependencies: flutter_stetho:(version) >> for example flutter_stetho: ^0.4.1

Note: Based on dart version only, choose the Stetho package version

  • For Flutter 1.7.x with Dart 2.4, use version 0.3.0
  • For Flutter 1.8.x+ with Dart 2.5, use version 0.4.0 or higher
like image 86
krishnaji Avatar answered Oct 13 '22 20:10

krishnaji