flutter_stetho 0.5.0
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.

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.
0.5.0 - 12 Sep 2019 #
- Update to work with Flutter Stable 0.19.1+hotfix.2
- Revert
UInt8List
back toList<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
- For Flutter 1.7.x with Dart 2.4, use version
0.4.0 - 18 July 2019 #
- Proper Fix for latest Dart 2.5 & Flutter 1.8.x -- use
Uint8List
instead ofList<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
flutter_stetho_example #
Demonstrates how to use the flutter_stetho plugin.
Getting Started #
For help getting started with Flutter, view our online documentation.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies:
flutter_stetho: ^0.5.0
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';
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
92
|
Health:
Code health derived from static analysis.
[more]
|
99
|
Maintenance:
Reflects how tidy and up-to-date the package is.
[more]
|
100
|
Overall:
Weighted score of the above.
[more]
|
96
|
We analyzed this package on Dec 9, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.6.1
- pana: 0.12.21
- Flutter: 1.9.1+hotfix.6
Platforms
Detected platforms: Flutter
References Flutter, and has no conflicting libraries.
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'.
Dependencies
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.11 | 1.14.12 | |
meta | 1.1.7 | 1.1.8 | |
sky_engine | 0.0.99 | ||
typed_data | 1.1.6 | ||
vector_math | 2.0.8 |