Skip to content

Commit

Permalink
Call out more limitations of runWithClient (#1248)
Browse files Browse the repository at this point in the history
Towards #828

Add a section in the `runWithClient` doc that mentions HTTP requests
which _aren't_ affected by usage of this API - specifically requests
made through the SDK core libraries, or through instantiating specific
client implementations.
  • Loading branch information
natebosch committed Jun 27, 2024
1 parent eb189e1 commit bf96551
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgs/http/lib/src/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ Client? get zoneClient {
/// and the convenience HTTP functions (e.g. [http.get]). If [clientFactory]
/// returns `Client()` then the default [Client] is used.
///
/// Only fresh `Client` instances using the default constructor are impacted.
/// HTTP requests made using `dart:io` or `dart:html` APIs,
/// or using specifically instantiated client implementations, are not affected.
///
/// When used in the context of Flutter, [runWithClient] should be called before
/// [`WidgetsFlutterBinding.ensureInitialized`](https://api.flutter.dev/flutter/widgets/WidgetsFlutterBinding/ensureInitialized.html)
/// because Flutter runs in whatever [Zone] was current at the time that the
Expand Down

0 comments on commit bf96551

Please sign in to comment.