http_mock_adapter 0.6.1 http_mock_adapter: ^0.6.1 copied to clipboard
A simple to use mocking package for Dio intended to be used in tests. It provides various types and methods to declaratively mock request-response communication.
Use this package as a library
Depend on it
Run this command:
With Dart:
$ dart pub add http_mock_adapter
With Flutter:
$ flutter pub add http_mock_adapter
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get
):
dependencies:
http_mock_adapter: ^0.6.1
Alternatively, your editor might support dart pub get
or flutter pub get
. Check the docs for your editor to learn more.
Import it
Now in your Dart code, you can use:
import 'package:http_mock_adapter/http_mock_adapter.dart';