flutter facebook stetho
facebook stetho is a plugin that connects flutter to the chrome dev tools on android devices via the facebook 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 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.
Comments are closed.