dio library
A dio adapter backed by nitro_http's
native libcurl engine.
import 'package:dio/dio.dart';
import 'package:nitro_http/dio.dart';
final dio = Dio()..useNitroHttp();
final res = await dio.get<Map<String, dynamic>>('https://example.com/api');
Import this library rather than package:nitro_http/nitro_http.dart — the
main barrel stays free of dio, so an app that never imports this file
tree-shakes the adapter away.
Classes
- NitroHttpDioAdapter
-
Routes every
diorequest through a nh.NitroHttpClient.
Extensions
- NitroHttpDio on Dio
-
Installs a NitroHttpDioAdapter on a
Dioinstance.
Constants
- nitroHttpCacheModeKey → const String
-
The
RequestOptions.extrakey that selects a nh.CacheMode for one request.
Functions
-
dioExceptionTypeOf(
NitroHttpException error) → DioExceptionType -
The
DioExceptionTypethat best describeserror.