-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add readme and changelog notes, add comment to dio mixin
- Loading branch information
1 parent
cc18bea
commit b127bba
Showing
5 changed files
with
34 additions
and
6 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
import 'package:dio/dio.dart'; | ||
import 'package:supertokens_flutter/src/dio-interceptor-wrapper.dart'; | ||
|
||
/// Mixin for easy Dio instance setup. | ||
/// | ||
/// Usage: | ||
/// ```dart | ||
/// | ||
/// final dio = Dio() | ||
/// ..addSupertokensInterceptor() | ||
/// ..addSentry() | ||
/// // ... | ||
/// ``` | ||
extension SuperTokensDioExtension on Dio { | ||
void addSupertokensInterceptor() { | ||
this.interceptors.add(SuperTokensInterceptorWrapper(client: this)); | ||
} | ||
} | ||
/// Adds the SuperTokens interceptor to the Dio instance. | ||
void addSupertokensInterceptor() { | ||
this.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