Skip to content

docs: change examples to use pub APIs - #1961

Merged
brianquinlan merged 21 commits into
dart-lang:masterfrom
brianquinlan:pub_example
Sep 15, 2026
Merged

brianquinlan merged 21 commits into
dart-lang:masterfrom
brianquinlan:pub_example

Conversation

@brianquinlan

@brianquinlan brianquinlan commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

The books API previously used by the package:http, package:cronet_http, package:ok_http, and package:cupertino_http examples never has available quota so the examples appear broken.

Switch the examples to use the Dart pub API.

The Flutter example in package:cronet_http and package:flutter_http_example is significantly more complex and looks like this:

image

The examples for the other packages are fairly simple.


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

Note: The Dart team is trialing Gemini Code Assist. Don't take its comments as final Dart team feedback. Use the suggestions if they're helpful; otherwise, wait for a human reviewer.

@github-actions github-actions Bot added package:cupertino_http Issues related to package:cupertino_http package:http package:cronet_http labels Aug 4, 2026
# Conflicts:
#	pkgs/cronet_http/CHANGELOG.md
#	pkgs/cronet_http/pubspec.yaml
#	pkgs/cupertino_http/CHANGELOG.md
#	pkgs/cupertino_http/pubspec.yaml
#	pkgs/ok_http/CHANGELOG.md

testWidgets('test search filters results', (WidgetTester tester) async {
final mockClient = MockClient((request) async {
if (request.url.path == '/api/package-name-completion-data') {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tried refactoring this chain into a switch on request.url.path and it ended up formatting worse 🤷

@brianquinlan
brianquinlan merged commit 35769ba into dart-lang:master Sep 15, 2026
53 of 54 checks passed
@brianquinlan
brianquinlan deleted the pub_example branch September 15, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants