Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 819 Bytes

File metadata and controls

34 lines (22 loc) · 819 Bytes

dio_flutter_transformer

A dio transformer especially for flutter, by which the json decoding will be in background with [compute] function.

Through practical experience, we find that although using compute can make tasks go on in the background, it may lead to slow task execution. So please think carefully before using it.

Install

dio_flutter_transformer:
    git:
      url: https://github.com/KoderLabs/dio_flutter_transformer
      ref: master

Usage

Import the package:

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

Then replace dio default transformer:

var dio=Dio();
dio.transformer = FlutterTransformer(); // replace dio default transformer
dio.get(...);