feat(network): add configureDriver() plugin hook for Dio access#35
Merged
anilcancakir merged 2 commits intomasterfrom Apr 5, 2026
Merged
feat(network): add configureDriver() plugin hook for Dio access#35anilcancakir merged 2 commits intomasterfrom
anilcancakir merged 2 commits intomasterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Adds a Dio-specific plugin hook to the Magic network stack so SDKs/adapters can configure the underlying Dio instance without exposing it via a public getter.
Changes:
- Add
DioNetworkDriver.configureDriver(void Function(Dio) configurator)to allow direct, driver-owned Dio configuration. - Add unit tests for
configureDriver()and sequential configurator usage. - Document the new hook in framework references + basics docs, and add a CHANGELOG entry.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
lib/src/network/drivers/dio_network_driver.dart |
Introduces configureDriver() hook to apply a callback to the internal Dio instance. |
test/network/network_test.dart |
Adds tests covering configurator invocation and multiple configurators. |
skills/magic-framework/references/http-network.md |
Documents the Dio driver plugin hook and how to access it. |
doc/basics/http-client.md |
Adds end-user docs for the new driver plugin hook usage. |
CHANGELOG.md |
Adds an Unreleased feature entry for the new hook. |
Enables SDK integrations (sentry_dio, cert pinning) that need raw Dio instance access. Configurator callback pattern keeps Dio conceptually owned by the driver while allowing one-time setup.
0e7840a to
2a1e074
Compare
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #32
Summary
DioNetworkDriver.configureDriver(void Function(Dio) configurator)for raw Dio instance accesssentry_dio, certificate pinning, custom adaptersNetworkDrivercontract — Dio-specific method onlyTest plan
configureDriver()applies configurator to Dio instancedart analyze: zero warnings