Http request inspector for Flutter application

Overview

Alice

pub package pub package pub package

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 inspired from Chuck (https://github.com/jgilfelt/chuck) and Chucker (https://github.com/ChuckerTeam/chucker).

Overlay bubble version of Alice: https://github.com/jhomlala/alice

Supported Dart http client plugins:

  • Dio
  • HttpClient from dart:io package
  • Http from http/http package
  • Chopper
  • Generic HTTP client

Features:
✔️ Detailed logs for each HTTP calls (HTTP Request, HTTP Response)
✔️ Inspector UI for viewing HTTP calls
✔️ Statistics
✔️ Support for top used HTTP clients in Dart
✔️ Error handling
✔️ HTTP calls search ✔️ Bubble overlay entry

Install

  1. Add this to your pubspec.yaml file:
dependencies:
  flutter_alice: ^1.0.1
  1. Install it
$ flutter pub get
  1. Import it
import 'package:flutter_alice/alice.dart';

Usage

Alice configuration

  1. Create Alice instance:
Alice alice = Alice();
  1. Add navigator key to your application:
MaterialApp( navigatorKey: alice.getNavigatorKey(), home: ...)

You need to add this navigator key in order to show inspector UI. You can use also your navigator key in Alice:

Alice alice = Alice(navigatorKey: yourNavigatorKeyHere);

If you need to pass navigatorKey lazily, you can use:

alice.setNavigatorKey(yourNavigatorKeyHere);

This is minimal configuration required to run Alice. Can set optional settings in Alice constructor, which are presented below. If you don't want to change anything, you can move to Http clients configuration.

Additional settings

If you want to use dark mode just add darkTheme flag:

Alice alice = Alice(..., darkTheme: true);

HTTP Client configuration

If you're using Dio, you just need to add interceptor.

Dio dio = Dio();
dio.interceptors.add(alice.getDioInterceptor());

If you're using HttpClient from dart:io package:

httpClient
	.getUrl(Uri.parse("https://jsonplaceholder.typicode.com/posts"))
	.then((request) async {
		alice.onHttpClientRequest(request);
		var httpResponse = await request.close();
		var responseBody = await httpResponse.transform(utf8.decoder).join();
		alice.onHttpClientResponse(httpResponse, request, body: responseBody);
 });

If you're using http from http/http package:

http.get('https://jsonplaceholder.typicode.com/posts').then((response) {
    alice.onHttpResponse(response);
});

If you're using Chopper. you need to add interceptor:

chopper = ChopperClient(
    interceptors: alice.getChopperInterceptor(),
);

If you have other HTTP client you can use generic http call interface:

AliceHttpCall aliceHttpCall = AliceHttpCall(id);
alice.addHttpCall(aliceHttpCall);

Extensions

You can use extensions to shorten your http and http client code. This is optional, but may improve your codebase. Example:

  1. Import:
import 'package:flutter_alice/core/alice_http_client_extensions.dart';
import 'package:flutter_alice/core/alice_http_extensions.dart';
  1. Use extensions:
http
    .post('https://jsonplaceholder.typicode.com/posts', body: body)
    .interceptWithAlice(alice, body: body);
httpClient
    .postUrl(Uri.parse("https://jsonplaceholder.typicode.com/posts"))
    .interceptWithAlice(alice, body: body, headers: Map());
You might also like...

A sample app of using the image_picker + path_provider and permission_handler package to request permission and store photos on mobile

A sample app of using the image_picker + path_provider and permission_handler package to request permission and store photos on mobile

image_picker_example A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you sta

Apr 19, 2022

Hava Durumu Uygulaması - Temel Api Request

Hava Durumu Uygulaması - Temel Api Request

Hava Ne Durumda Bu uygulama temelde apilerle nasıl çalışılır, apiden veri nasıl GET edilir gibi işlemleri anlamak için yapılmıştır. Uygulama Fotoğrafl

Jun 14, 2022

Simple and hackable request for dart

Simple and hackable request for dart

Simple and hackable request for dart

Sep 22, 2022

📖 A Guide for your first pull request

 📖 A Guide for your first pull request

📖 A Guide for your first pull request This project has been excluded by Hacktoberfest 2022 ✨ This project will help you to make your first pull reque

Dec 2, 2022

A CLI tool to verify the test coverage of a pull request only, ignoring the rest of the project

A CLI tool to verify the test coverage of a pull request only, ignoring the rest of the project

This is a CI tool that analyzes the coverage rate of a pull request, ignoring the lines that were not changed in the PR. Motivation The coverage rate

Dec 15, 2022

Flutter Github Following Application, Using Flutter Provider and Flutter HTTP to get data from Github API.

Flutter Github Following Application, Using Flutter Provider and Flutter HTTP to get data from Github API.

Flutter Github Following Application Watch it on Youtube Previous Designs Checkout my Youtube channel Installation Please remember, after cloning this

Dec 23, 2022

A shopper Flutter app that use BloC pattern and CRUD operations with different ways(memory/sqlite/http)

A shopper Flutter app that use BloC pattern and CRUD operations with different ways(memory/sqlite/http)

The project is maintained by a non-profit organisation, along with an amazing collections of Flutter samples. We're trying to make continuous commits

Nov 10, 2022

Generates a new Flutter app with http client, theme, routing and localization features.

Starter Template Generates a new Flutter app with http client, theme, routing and localization features. Brick Uses: dio as http client pretty_dio_log

Nov 3, 2022

Flutter Rest API using Http and Provider State.

Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is your first Flutter project:

Aug 31, 2022
Owner
Hau Tran
Turning coffee into code
Hau Tran
A powerful Http client for Dart, which supports Interceptors, FormData, Request Cancellation, File Downloading, Timeout etc.

Language: English | 中文简体 dio A powerful Http client for Dart, which supports Interceptors, Global configuration, FormData, Request Cancellation, File

Flutter中国开源项目 11.2k Jan 3, 2023
Avo Inspector SDK for Flutter

Avo Inspector for Flutter @Hacktoberfest Happy Hacktoberfest! This repo is participating, check out the issues we've prepared for you If you need any

Avo 10 Oct 25, 2022
An easy-to-use flutter http network requests handler with more functionality than http but more simpler than dio.

network_requests An easy-to-use flutter http network requests handler with more functionality than http but more simpler than dio. Platform Supported

Coder_Manuel 3 Dec 15, 2022
App HTTP Client is a wrapper around the HTTP library Dio to make network requests and error handling simpler, more predictable, and less verbose.

App HTTP Client App HTTP Client is a wrapper around the HTTP library Dio to make network requests and error handling simpler, more predictable, and le

Joanna May 44 Nov 1, 2022
Charlatan - A library for configuring and providing fake http responses to your dio HTTP client.

charlatan This package provides the ability to configure and return fake HTTP responses from your Dio HTTP Client. This makes it easy to test the beha

Betterment 14 Nov 28, 2022
A Flutter plugin to request the device unlock screen.

device_unlock A Flutter plugin to request the device unlock screen on Android and iOS. How does it work The following attempts and fallbacks are made:

Cíngulo 19 Sep 7, 2022
Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.

Flutter permission_handler plugin The Flutter permission_handler plugin is build following the federated plugin architecture. A detailed explanation o

Baseflow 1.7k Dec 31, 2022
Unloc customizations of the Permission plugin for Flutter. This plugin provides an API to request and check permissions.

Flutter Permission handler Plugin A permissions plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check perm

Unloc 1 Nov 26, 2020
This repo contains a collection of permission related Flutter plugins which can be used to request permissions to access device resources in a cross-platform way.

Flutter Permission Plugins Deprecation Notice This repository has been replaced by the Flutter permission_handler plugin and will not longer be mainta

Baseflow 51 Dec 13, 2021
Youtube API in Dart app. Used for downloading media and search request.

Youtube API Youtube API made by using Dart and Flutter in a cross-platform app. Used for downloading media and search request. For an idea of how the

Avian Silviu-Gabriel 0 Nov 4, 2021