flutter_stetho 0.6.0-dev.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 95

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() {

  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.

0.6.0-dev.1 - 12 Sep 2019 #

  • Update to work with latest master with defaultBinaryMessenger enabled
    • 1.10.2-pre.54

0.5.0 - 12 Sep 2019 #

  • Update to work with Flutter Stable 0.19.1+hotfix.2
  • Revert UInt8List back to List<int>

0.4.1 - 19 July 2019 #

  • Update docs to specify correct version for Flutter
    • 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

0.4.0 - 18 July 2019 #

  • Proper Fix for latest Dart 2.5 & Flutter 1.8.x -- use Uint8List instead of List<int>

0.3.0 - 16 July 2019 #

  • Fix missing compressionState error.

0.2.2 - 10 Nov 2018 #

  • Bugfix: Show correct request headers when using http client

0.2.1 - 19 Oct 2018 #

  • Bugfix: Imports were broken

0.2.0 - 19 Oct 2018 #

  • BREAKING CHANGE: Use Stetho.initialize() instead of overriding the HTTP Client!
  • This allows us to initialize the Android code only when Stetho.initialize() is invoked, rather than running Stetho by default, which is bad for production builds.
  • More work to be done on stripping the plugin from the APK during production builds. Flutter issue opened.

0.1.2 - 17 Aug 2018 #

  • Fix connectionTimeout. Thanks @pcqpcq!

0.1.1 - 27 Apr 2018 #

  • Fix docs

0.1.0 - 27 Apr 2018 #

  • Fix for Dart 2. Thanks @thejakeofink!

0.0.1 - 4 Mar 2018 #

  • Initial version, with support for network inspection on Android via the Chrome Dev Tools using Stetho


import 'package:flutter/material.dart';
import 'package:flutter_stetho/flutter_stetho.dart';
import 'package:http/http.dart' as http;

void main() {

  runApp(new FlutterStethoExample(
    client: new http.Client(),

class FlutterStethoExample extends StatelessWidget {
  final http.Client client;

  FlutterStethoExample({Key key, this.client}) : super(key: key);

  fetchImage() {
      headers: {'Authorization': 'token'},

  fetchJson() {
      headers: {'Authorization': 'token'},

  fetchError() {

  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('Plugin example app'),
        body: new Center(
          child: new Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              new Padding(
                padding: new EdgeInsets.all(16.0),
                child: new RaisedButton(
                  onPressed: fetchJson,
                  child: new Text("Fetch json"),
              new Padding(
                padding: new EdgeInsets.all(16.0),
                child: new RaisedButton(
                  onPressed: fetchImage,
                  child: new Text("Fetch image"),
              new Padding(
                padding: new EdgeInsets.all(16.0),
                child: new RaisedButton(
                  onPressed: fetchError,
                  child: new Text("Fetch with Error"),

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_stetho: ^0.6.0-dev.1

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_stetho/flutter_stetho.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jun 12, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.9+1
  • Flutter: 1.17.3

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:flutter_stetho/flutter_stetho.dart]

Package does not support Flutter platform macos

Because of import path [package:flutter_stetho/flutter_stetho.dart]

Package does not support Flutter platform web

Because of import path [package:flutter_stetho/flutter_stetho.dart]

Package does not support Flutter platform windows

Because of import path [package:flutter_stetho/flutter_stetho.dart]

Package not compatible with SDK dart

because of import path [flutter_stetho]

Health suggestions

Fix lib/src/http_client_response.dart. (-0.50 points)

Analysis of lib/src/http_client_response.dart reported 1 hint:

line 3 col 8: Unused import: 'dart:typed_data'.

Fix lib/src/utils.dart. (-0.50 points)

Analysis of lib/src/utils.dart reported 1 hint:

line 4 col 8: Unused import: 'dart:typed_data'.

Maintenance suggestions

Package is pre-release. (-5 points)

Pre-release versions should be used with caution; their API can change in breaking ways.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8