flipperkit_dio_interceptor 0.0.2

  • Readme
  • Changelog
  • Installing
  • 67

flipperkit_dio_interceptor #

pub package Donate

English | 简体中文

flutter_flipperkit already supports global interception of network requests (all requests based on HttpClient API can be intercepted), if you do not set the network plugin useHttpOverrides parameter to false, you do not need to use this interceptor.

Getting Started #

Prerequisites #

Before starting make sure you have:

Installation #

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

dependencies:
  flipperkit_dio_interceptor: ^0.0.1

You can install packages from the command line:

$ flutter packages get

Usage #

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

void sendRequest() async {
  Dio dio = new Dio();
  dio.interceptors.add(FlipperKitDioInterceptor());
  Response response = dio.get("https://example.com");
}

Discussion #

If you have any suggestions or questions about this project, you can discuss it by Telegram or my wechat.

License #

MIT License

Copyright (c) 2019 JianyingLi <lijy91@foxmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

0.0.1 #

  • Initial release

Use this package as a library

1. Depend on it

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


dependencies:
  flipperkit_dio_interceptor: ^0.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:flipperkit_dio_interceptor/flipperkit_dio_interceptor.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
54
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
48
Overall:
Weighted score of the above. [more]
67
Learn more about scoring.

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

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

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/flipperkit_dio_interceptor.dart.

Run flutter format to format lib/flipperkit_dio_interceptor.dart.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (dio).

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and flipperkit_dio_interceptor.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Update README.md. (-2 points)

1 image link is insecure (e.g. http://blankapp.org/assets/images/wechat_qrcode.png), use https URLs instead.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
dio ^2.0.14 2.2.2 3.0.4
flutter 0.0.0
flutter_flipperkit ^0.0.6 0.0.20
uuid ^2.0.0 2.0.4
Transitive dependencies
charcode 1.1.2
collection 1.14.11 1.14.12
convert 2.1.1
cookie_jar 1.0.1
crypto 2.1.3
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test