Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call out more limitations of runWithClient #1248

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to replace the Flutter section. Are you working on that or should I keep going?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you working on that or should I keep going?

I wasn't planning on looking more deeply at the Flutter stuff. I noticed this was a gap in the docs, even outside of the specifics of Flutter usage, so I think getting the general message added is a useful and easy first step.

/// [`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