-
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
Conversation
Hi @daniil-borovoy You can mark me as a reviewer for this whenever you are ready for this PR to be merged |
Sure! |
import 'package:supertokens_flutter/dio.dart'; | ||
|
||
void setup() { | ||
Dio dio = Dio(); // Create a Dio instance. | ||
dio.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.
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.
Co-authored-by: Rishabh Poddar <[email protected]>
Summary of change
Related issues