dio_flutter_transformer 3.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 95

dio_flutter_transformer Pub

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 #

dependencies:
  dio_flutter_transformer: ^3.0.2 # latest version

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(...);

[3.0.2] - 2019.9.19

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

example/example.dart

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

main() async {
    var dio = Dio();
    // replace dio default transformer
    dio.transformer = new FlutterTransformer();

    //....
    Response response =
        await dio.get("https://api.github.com/orgs/flutterchina/repos");
    print(response.data);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dio_flutter_transformer: ^3.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dio_flutter_transformer/dio_flutter_transformer.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
90
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
95
Learn more about scoring.

We analyzed this package on Nov 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >2.4.0 <3.0.0
dio ^3.0.0 3.0.6
flutter 0.0.0
Transitive dependencies
charcode 1.1.2
collection 1.14.11 1.14.12
http_parser 3.1.3
meta 1.1.7 1.1.8
path 1.6.4
sky_engine 0.0.99
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test