Dio Brotli transformer

Pub

Brotli response support for Dio http client

Get started

Installation

In pubspec.yaml add the following dependency:

dependencies:
  dio_brotli_transformer: ^2.0.0

Super simple to use

import 'package:dio/dio.dart';
import 'package:dio_brotli_transformer/dio_brotli_transformer.dart';

final dio = Dio(
  BaseOptions(
    headers: {
      'accept-encoding': 'br',
    },
  ),
);


dio.transformer =

DioBrotliTransformer();

Examples

Change default transformer

import 'package:dio/dio.dart';
import 'package:dio_brotli_transformer/dio_brotli_transformer.dart';

final dio = Dio(
  BaseOptions(
    headers: {
      'accept-encoding': 'br',
    },
  ),
);


dio.transformer = DioBrotliTransformer
(
transformer
:
DefaultTransformer
(
)
);