http_interceptor 2.0.0 copy "http_interceptor: ^2.0.0" to clipboard
http_interceptor: ^2.0.0 copied to clipboard

A lightweight, simple plugin that allows you to intercept request and response objects and modify them if desired.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:http_interceptor_example/multipart_app.dart';

import 'weather_app.dart';

void main() => runApp(const ExamplesApp());

class ExamplesApp extends StatelessWidget {
  const ExamplesApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: ExamplesMenuScreen(),
    );
  }
}

class ExamplesMenuScreen extends StatelessWidget {
  const ExamplesMenuScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Examples'),
      ),
      body: ListView(
        shrinkWrap: true,
        children: [
          ListTile(
            leading: const Icon(Icons.cloud),
            title: const Text('Weather Example'),
            subtitle: const Text('Simple HTTP Intercepting'),
            onTap: () => Navigator.push<void>(context, WeatherApp.route()),
          ),
          ListTile(
            leading: const Icon(Icons.photo),
            title: const Text('Remove Img Background Example'),
            subtitle: const Text('Multipart Intercepting'),
            onTap: () => Navigator.push<void>(context, MultipartApp.route()),
          ),
        ],
      ),
    );
  }
}
193
likes
160
points
56.4k
downloads

Publisher

verified publishercodingale.dev

Weekly Downloads

A lightweight, simple plugin that allows you to intercept request and response objects and modify them if desired.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (license)

Dependencies

http

More

Packages that depend on http_interceptor