Vipin Vijayan

Debugging Network Calls in Flutter with Alice

Watch Video

Debugging Network Calls in Flutter with Alice

In this article I am showing a useful plugin to debug network calls in Flutter.

Alice!

You can find the alice package here.

Alice is an HTTP Inspector tool for Flutter which helps debugging http requests. It catches and stores http requests and responses, which can be viewed via simple UI.

It is simple to integrate!

First add the dependency in pubspec.yaml.

dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.3
alice: ^0.2.5
http: ^0.13.4

Create instance of Alice.

Alice alice = Alice();

Attach alice to your network calls.

import 'package:http/http.dart' as http;final response = await http        .get(Uri.parse('https://jsonplaceholder.typicode.com/posts/1'));if (kDebugMode) alice.onHttpResponse(response);

Open Debug info UI

After the network call has been made, you can open up alice inspector using the below code.

alice.showInspector();

--

--

Vipin Vijayan

Vipin Vijayan

I am a developer focussing mainly in the mobile space. I work in platforms like Android, iOS, Flutter, React Native etc.