-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add dio extension for flexible interseptor setup and update dio and mutex packages #47
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d65708f
build: bump package versions
daniilborovoy d5d82b0
feat: add supertokens interceptor extension
daniilborovoy cc18bea
fix: ext import
daniilborovoy b127bba
docs: add readme and changelog notes, add comment to dio mixin
daniilborovoy e83b684
docs: update changelog notes
daniilborovoy f2e7103
feat: add dio extension test
daniilborovoy 6c2ff55
chore: remove imports with no usages from tests
daniilborovoy 51bae0a
refactor: fix comment and remove explicit this for dio ext
daniilborovoy a1bdf9e
fix: pubspec loc deps content caused by using different version of fl…
daniilborovoy 32ea22d
docs: bump sdk version to 0.2.9
daniilborovoy abb1c89
chore: change dio version to ^5.0.0
daniilborovoy ac957db
docs: bump sdk version to 0.3.0
daniilborovoy 26a367e
docs: fix changelog notes
daniilborovoy 3189298
docs: changelog release typo
daniilborovoy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export 'src/dio-interceptor-wrapper.dart' show SuperTokensInterceptorWrapper; | ||
export 'src/supertokens_dio_extension.dart' show SuperTokensDioExtension; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'package:dio/dio.dart'; | ||
import 'package:supertokens_flutter/src/dio-interceptor-wrapper.dart'; | ||
|
||
/// Dio extension for flexible Dio instance setup. | ||
/// | ||
/// Usage: | ||
/// ```dart | ||
/// import "package:supertokens_flutter/dio.dart"; | ||
/// | ||
/// final dio = Dio() | ||
/// ..addSupertokensInterceptor() | ||
/// ..addSentry() | ||
/// // ... | ||
/// ``` | ||
extension SuperTokensDioExtension on Dio { | ||
rishabhpoddar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// Adds the SuperTokens interceptor to the Dio instance. | ||
void addSupertokensInterceptor() { | ||
interceptors.add(SuperTokensInterceptorWrapper(client: this)); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class Version { | ||
static List<String> supported_fdi = ["1.16", "1.17", "1.18"]; | ||
static String sdkVersion = "0.2.8"; | ||
static String sdkVersion = "0.3.0"; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
library supertokens; | ||
|
||
export "src/supertokens.dart"; | ||
export "src/errors.dart"; | ||
export "src/errors.dart"; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this a better way over the existing method? If so, do you think we should recommend this method on our website docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was inspired by the Flutter Sentry SDK and they do the same thing in their SDK. So you can use the cascade operator and make something like this
Dio(options) ..addSentry() ..addSupertokensInterceptor()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha! thanks. Keeping this comment open cause we will add it to our docs.