monitor_http 1.1.0 copy "monitor_http: ^1.1.0" to clipboard
monitor_http: ^1.1.0 copied to clipboard

HTTP client helpers for Monitor with tracking enabled by default.

Monitor HTTP #

pub.dev style: very good analysis

Monitor HTTP is a tiny helper package that wraps the http client and logs requests and responses through the monitor package automatically.

Installation #

dependencies:
  monitor_http: ^0.1.0
flutter pub add monitor_http

Usage #

Initialize Monitor once at app startup:

import 'package:flutter/material.dart';
import 'package:monitor/monitor.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  Monitor.init();

  runApp(const MyApp());
}

Create a tracked HTTP client:

import 'package:http/http.dart' as http;
import 'package:monitor_http/monitor_http.dart';

final http.Client client = createMonitorClient();

final response = await client.get(
  Uri.parse('https://api.example.com/users'),
);

You can also wrap an existing client:

final http.Client client = MonitorHttpClient(
  inner: http.Client(),
);

All requests made with the client will appear in the Monitor viewer and logs.

License #

Apache-2.0. See LICENSE for details.

0
likes
160
points
115
downloads

Publisher

verified publisheramaan.dev

Weekly Downloads

HTTP client helpers for Monitor with tracking enabled by default.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, http, monitor

More

Packages that depend on monitor_http