runZoned<R> static method

R runZoned<R>(
  1. R body(
      ),
    1. {HttpClient createHttpClient(
      1. SecurityContext?
      )?,
    2. String findProxyFromEnvironment(
      1. Uri uri,
      2. Map<String, String>? environment
      )?}
    )

    Runs body in a fresh Zone using the provided overrides.

    Implementation

    static R runZoned<R>(R Function() body,
        {HttpClient Function(SecurityContext?)? createHttpClient,
        String Function(Uri uri, Map<String, String>? environment)?
            findProxyFromEnvironment}) {
      HttpOverrides overrides =
          _HttpOverridesScope(createHttpClient, findProxyFromEnvironment);
      return _asyncRunZoned<R>(body,
          zoneValues: {_httpOverridesToken: overrides});
    }