Skip to main content

Flutter Network Inspector

 Effortlessly monitor your app’s network calls with this simple and easy-to-use package for the http! library.

Features 

  • Monitor network calls within the app
  • View all details in the Flutter UI itself.
  • Turn on and off whenever you want.

Demo 

App Screenshot

Getting started 

Create a client for your network calls, which is an object of FNIClient. Then use this client to do all network calls. You can also use the network inspector UI to view all the info about the network calls. The UI is fully compatible with your app's theme.

Usage 

// Using Dio Client final dioClient = FNI.init(dio: Dio()); // Enable/Disable logging FNI.setEnableLogging(false); // Use the client to do the calls var response = await dioClient.get( 'https://jsonplaceholder.typicode.com/posts/1', options: Options( headers: {'Content-Type': 'application/json'}, ), data: '{"title": "foo", "body": "bar", "userId": 1}', ); // Using Http Client final httpClient = FNI.init(httpClient: http.Client()); // Enable/Disable logging FNI.setEnableLogging(false); // Use the client to do the calls var response = await httpClient.post( Uri.parse('https://jsonplaceholder.typicode.com/posts/1'), headers: {'Content-Type': 'application/json'}, body: '{"title": "foo", "body": "bar", "userId": 1}', );


To view the details of network calls, you can add the Flutter network inspector UI anywhere in your widget tree.

 @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        elevation: 3,
        title: const Text('Flutter Network Inspector'),
      ),
      body: const FNIHome(), // show all network activity, use it with your navigator too.
    );
  }

Comments

Popular posts from this blog

Flutter Themer

  Introducing Flutter Themer ! Are you a Flutter developer looking to customize and fine-tune your app’s theme effortlessly? Look no further! With Flutter Themer flutterthemer.github.io , you can: Create beautiful color schemes Preview your theme in real-time Export theme data easily into your Flutter app Whether you’re building the next big thing or just tinkering with design, Flutter Themer is your go-to tool for fast, seamless theme generation! Check it out now and make your app stand out!