create static method

Future<RhttpClient> create({
  1. ClientSettings? settings,
  2. List<Interceptor>? interceptors,
})

Creates a new HTTP client asynchronously. Use this method if your app is already running to avoid blocking the UI.

Implementation

static Future<RhttpClient> create({
  ClientSettings? settings,
  List<Interceptor>? interceptors,
}) async {
  settings ??= const ClientSettings();
  final ref = await rust.registerClient(
    settings: settings.toRustType(),
  );
  return RhttpClient._(
    settings: settings,
    interceptor: parseInterceptorList(interceptors),
    ref: ref,
  );
}