Coder Social home page Coder Social logo

peterombodi / flutter_stetho Goto Github PK

View Code? Open in Web Editor NEW

This project forked from irdevp/flutter_stetho

0.0 0.0 1.0 7.95 MB

Integrate Flutter with the Facebook Stetho tool for Android

License: MIT License

Java 32.15% Ruby 11.45% Objective-C 1.93% Dart 52.18% Kotlin 1.15% Swift 1.13%

flutter_stetho's Introduction

flutter_stetho

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

Bug on Inspector of Google Chrome

info: In the last update of Google Chrome, there is a bug in the inspect, so use other browsers based on the older versions of chrome, like Brave.

Install

Add flutter_stetho as dependency to your pubspec.yaml

dev_dependencies:
  flutter_stetho:  
    git:
      url: git://github.com/irdevp/flutter_stetho.git
      ref: master

Add on main.dart

import 'package:flutter_stetho/flutter_stetho.dart';

void main() {
  Stetho.initialize();

  runApp(MyApp());
}

Tutorial Network Inspector on Brave

navigate to chrome://inspect

Network Inspector Brave

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
  • For Flutter 2.x, use version 0.6.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.

flutter_stetho's People

Forkers

dimabrahin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.