Search packages, repositories and app categories

Package detailsv0.5.2

flutter_stetho

A network inspector for Flutter on Android using the Chrome Dev Tools

30-day downloads
607
Likes
42
Pub points
35

Install package

flutter pub add flutter_stetho

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

flutter_stetho is a debugging tool that integrates Chrome DevTools with Flutter on Android, enabling developers to inspect network requests and responses in real time. It leverages the Stetho library from Facebook to provide detailed insights into HTTP traffic, including headers, payloads, and timing. This package enhances the development workflow by offering a familiar interface for diagnosing network-related issues without requiring additional setup beyond adding the dependency. It's particularly useful during app development and testing phases.

Use cases

  • Inspecting HTTP requests and responses
  • Debugging API integrations
  • Monitoring network performance
  • Troubleshooting connectivity issues
  • Real-time network logging

Key features

  • Chrome DevTools integration
  • Network request inspection
  • Real-time traffic monitoring
  • Simple setup via pub add
  • Android-only support

Suitable for

  • Flutter developers debugging network calls
  • Teams using Chrome DevTools workflows
  • Mobile app testers focusing on API behavior

Considerations

  • Limited to Android platform
  • Not suitable for production builds
  • Requires Chrome DevTools
  • May impact performance in debug mode
  • No iOS support

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

flutter_stetho

A plugin that connects Flutter to the Chrome Dev Tools on Android devices via the Stetho Android Library.

Network Inspector

The main feature I was aiming to achieve was a Network Inspector.

Network Inspector in Action

Getting Started

How can you too get this plugin up and running in your own app? Follow these steps.

Install the plugin

Add flutter_stetho to your dependencies in the pubspec.yaml file

  • For Flutter 1.7.x, use version 0.3.x
  • For Flutter 1.8.x, use version 0.4.x
  • For Flutter 1.9.x, use version 0.5.x
Install StethoHttpOverrides

Next, you'll need to install the Stetho.initialize() in the main() function of your app. This will enable Stetho and allow flutter_stetho to wrap all http calls and report information to the Chrome Dev Tools via the Stetho package from Facebook.

Note: It's probably a good idea only put this override in a main_dev.dart file.

void main() {
  Stetho.initialize();

  runApp(new MyApp());
}
Run your app on an Android Device

flutter run

Open Chrome

Pop open Chrome or Chromium, navigate to chrome://inspect

You should now see your App appear in the window.

Known Issues

  • Timing may be slightly off for some requests. That's because:
  • Code is rough mvp / prototype code. Needs improvement.
  • Animated Gifs not working
  • Some error cases may not be properly handled. Need more testing / feedback to find problems.
  • No Tests
  • If the app shuts down on start up run flutter clean to remove old builds.

Categories

Source repository

Projects using this package