How to monitor Network Request in Flutter

Muneef M
Intercept.Rest
Published in
2 min readMay 21, 2020

Flutter can be used to build high-performance, high-fidelity, apps for Both IOS and Android. But when it comes to Managing or monitoring network request it still requires a lot of work. But thanks to Interceptor.rest the job is a lot easier now.

In this post, I will show you how to monitor network request in Flutter

  • Let's create a simple Demo flutter app by following the official Doc
  • and now assuming that you are ready with your boilerplate code. lets open lib/main.dart
  • Now for the Network request, let's add http to the dependencies, follow Doc
  • Let's write the code for network fetch.
  • And now the most awaited part. Let's create an Interceptor URL.

In this demo we are using this API URL https://raw.githubusercontent.com/Muneefm/demo_data/master/movie.json

  • Go to https://app.intercept.rest and create an account. After that create a new Interceptor providing the Endpoint URL as the base of our API URL
  • And now on the next screen, we will receive a new Interceptor URL as shown in the image below
  • Copy the first URL and replace it in the Source code. and Don't forget to add a URL Path to this.
  • Now, let's open up the app, and press the button to trigger network calls.
  • Go to the Interceptor dashboard and see all network request done by your app.
  • That’s it. Now you can debug network requests more easily.

Full code in main.dart

--

--