Skip to content

Commit

Permalink
Fix flutter code type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
nkshah2 committed Nov 15, 2023
1 parent c706683 commit d204a40
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 25 deletions.
14 changes: 10 additions & 4 deletions v2/emailpassword/custom-ui/handling-session-tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ You can make requests as you normally would with `http`, the only difference is
// Import http from the SuperTokens package
import 'package:supertokens_flutter/http.dart' as http;
Future<void> makeRequest() {
Future<void> makeRequest() async {
Uri uri = Uri.parse("http://localhost:3001/api");
var response = await http.get(uri);
// handle response
Expand All @@ -230,11 +230,13 @@ If you use a custom http client and want to use SuperTokens, you can simply prov
// Import http from the SuperTokens package
import 'package:supertokens_flutter/http.dart' as http;
Future<void> makeRequest() {
Future<void> makeRequest() async {
Uri uri = Uri.parse("http://localhost:3001/api");
// Initialise your custom client
var customClient = http.Client();
// provide your custom client to SuperTokens
var httpClient = http.Client(client: customClient)
var httpClient = http.Client(client: customClient);
var response = await httpClient.get(uri);
// handle response
Expand All @@ -250,6 +252,7 @@ Use the extension method provided by the SuperTokens SDK to enable interception

```dart
import 'package:supertokens_flutter/dio.dart';
import 'package:dio/dio.dart';
void setup() {
Dio dio = Dio(); // Create a Dio instance.
Expand All @@ -263,9 +266,12 @@ You can make requests as you normally would with `dio`.

```dart
import 'package:supertokens_flutter/dio.dart';
import 'package:dio/dio.dart';
void setup() {
Dio dio = Dio(...)
Dio dio = Dio(
// Provide your config here
);
dio.addSupertokensInterceptor();
var response = dio.get("http://localhost:3001/api");
Expand Down
14 changes: 10 additions & 4 deletions v2/passwordless/custom-ui/handling-session-tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ You can make requests as you normally would with `http`, the only difference is
// Import http from the SuperTokens package
import 'package:supertokens_flutter/http.dart' as http;
Future<void> makeRequest() {
Future<void> makeRequest() async {
Uri uri = Uri.parse("http://localhost:3001/api");
var response = await http.get(uri);
// handle response
Expand All @@ -230,11 +230,13 @@ If you use a custom http client and want to use SuperTokens, you can simply prov
// Import http from the SuperTokens package
import 'package:supertokens_flutter/http.dart' as http;
Future<void> makeRequest() {
Future<void> makeRequest() async {
Uri uri = Uri.parse("http://localhost:3001/api");
// Initialise your custom client
var customClient = http.Client();
// provide your custom client to SuperTokens
var httpClient = http.Client(client: customClient)
var httpClient = http.Client(client: customClient);
var response = await httpClient.get(uri);
// handle response
Expand All @@ -250,6 +252,7 @@ Use the extension method provided by the SuperTokens SDK to enable interception

```dart
import 'package:supertokens_flutter/dio.dart';
import 'package:dio/dio.dart';
void setup() {
Dio dio = Dio(); // Create a Dio instance.
Expand All @@ -263,9 +266,12 @@ You can make requests as you normally would with `dio`.

```dart
import 'package:supertokens_flutter/dio.dart';
import 'package:dio/dio.dart';
void setup() {
Dio dio = Dio(...)
Dio dio = Dio(
// Provide your config here
);
dio.addSupertokensInterceptor();
var response = dio.get("http://localhost:3001/api");
Expand Down
14 changes: 10 additions & 4 deletions v2/session/quick-setup/handling-session-tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ You can make requests as you normally would with `http`, the only difference is
// Import http from the SuperTokens package
import 'package:supertokens_flutter/http.dart' as http;
Future<void> makeRequest() {
Future<void> makeRequest() async {
Uri uri = Uri.parse("http://localhost:3001/api");
var response = await http.get(uri);
// handle response
Expand All @@ -230,11 +230,13 @@ If you use a custom http client and want to use SuperTokens, you can simply prov
// Import http from the SuperTokens package
import 'package:supertokens_flutter/http.dart' as http;
Future<void> makeRequest() {
Future<void> makeRequest() async {
Uri uri = Uri.parse("http://localhost:3001/api");
// Initialise your custom client
var customClient = http.Client();
// provide your custom client to SuperTokens
var httpClient = http.Client(client: customClient)
var httpClient = http.Client(client: customClient);
var response = await httpClient.get(uri);
// handle response
Expand All @@ -250,6 +252,7 @@ Use the extension method provided by the SuperTokens SDK to enable interception

```dart
import 'package:supertokens_flutter/dio.dart';
import 'package:dio/dio.dart';
void setup() {
Dio dio = Dio(); // Create a Dio instance.
Expand All @@ -263,9 +266,12 @@ You can make requests as you normally would with `dio`.

```dart
import 'package:supertokens_flutter/dio.dart';
import 'package:dio/dio.dart';
void setup() {
Dio dio = Dio(...)
Dio dio = Dio(
// Provide your config here
);
dio.addSupertokensInterceptor();
var response = dio.get("http://localhost:3001/api");
Expand Down
2 changes: 1 addition & 1 deletion v2/src/plugins/codeTypeChecking/dart_env/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ packages:
source: hosted
version: "1.0.5"
dio:
dependency: transitive
dependency: "direct main"
description:
name: dio
sha256: "417e2a6f9d83ab396ec38ff4ea5da6c254da71e4db765ad737a42af6930140b7"
Expand Down
1 change: 1 addition & 0 deletions v2/src/plugins/codeTypeChecking/dart_env/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies:
supertokens_flutter: ^0.3.0
google_sign_in: ^6.1.4
sign_in_with_apple: ^5.0.0
dio: ^5.3.3

dev_dependencies:
flutter_test:
Expand Down
14 changes: 10 additions & 4 deletions v2/thirdparty/custom-ui/handling-session-tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ You can make requests as you normally would with `http`, the only difference is
// Import http from the SuperTokens package
import 'package:supertokens_flutter/http.dart' as http;
Future<void> makeRequest() {
Future<void> makeRequest() async {
Uri uri = Uri.parse("http://localhost:3001/api");
var response = await http.get(uri);
// handle response
Expand All @@ -230,11 +230,13 @@ If you use a custom http client and want to use SuperTokens, you can simply prov
// Import http from the SuperTokens package
import 'package:supertokens_flutter/http.dart' as http;
Future<void> makeRequest() {
Future<void> makeRequest() async {
Uri uri = Uri.parse("http://localhost:3001/api");
// Initialise your custom client
var customClient = http.Client();
// provide your custom client to SuperTokens
var httpClient = http.Client(client: customClient)
var httpClient = http.Client(client: customClient);
var response = await httpClient.get(uri);
// handle response
Expand All @@ -250,6 +252,7 @@ Use the extension method provided by the SuperTokens SDK to enable interception

```dart
import 'package:supertokens_flutter/dio.dart';
import 'package:dio/dio.dart';
void setup() {
Dio dio = Dio(); // Create a Dio instance.
Expand All @@ -263,9 +266,12 @@ You can make requests as you normally would with `dio`.

```dart
import 'package:supertokens_flutter/dio.dart';
import 'package:dio/dio.dart';
void setup() {
Dio dio = Dio(...)
Dio dio = Dio(
// Provide your config here
);
dio.addSupertokensInterceptor();
var response = dio.get("http://localhost:3001/api");
Expand Down
14 changes: 10 additions & 4 deletions v2/thirdpartyemailpassword/custom-ui/handling-session-tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ You can make requests as you normally would with `http`, the only difference is
// Import http from the SuperTokens package
import 'package:supertokens_flutter/http.dart' as http;
Future<void> makeRequest() {
Future<void> makeRequest() async {
Uri uri = Uri.parse("http://localhost:3001/api");
var response = await http.get(uri);
// handle response
Expand All @@ -230,11 +230,13 @@ If you use a custom http client and want to use SuperTokens, you can simply prov
// Import http from the SuperTokens package
import 'package:supertokens_flutter/http.dart' as http;
Future<void> makeRequest() {
Future<void> makeRequest() async {
Uri uri = Uri.parse("http://localhost:3001/api");
// Initialise your custom client
var customClient = http.Client();
// provide your custom client to SuperTokens
var httpClient = http.Client(client: customClient)
var httpClient = http.Client(client: customClient);
var response = await httpClient.get(uri);
// handle response
Expand All @@ -250,6 +252,7 @@ Use the extension method provided by the SuperTokens SDK to enable interception

```dart
import 'package:supertokens_flutter/dio.dart';
import 'package:dio/dio.dart';
void setup() {
Dio dio = Dio(); // Create a Dio instance.
Expand All @@ -263,9 +266,12 @@ You can make requests as you normally would with `dio`.

```dart
import 'package:supertokens_flutter/dio.dart';
import 'package:dio/dio.dart';
void setup() {
Dio dio = Dio(...)
Dio dio = Dio(
// Provide your config here
);
dio.addSupertokensInterceptor();
var response = dio.get("http://localhost:3001/api");
Expand Down
14 changes: 10 additions & 4 deletions v2/thirdpartypasswordless/custom-ui/handling-session-tokens.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ You can make requests as you normally would with `http`, the only difference is
// Import http from the SuperTokens package
import 'package:supertokens_flutter/http.dart' as http;
Future<void> makeRequest() {
Future<void> makeRequest() async {
Uri uri = Uri.parse("http://localhost:3001/api");
var response = await http.get(uri);
// handle response
Expand All @@ -230,11 +230,13 @@ If you use a custom http client and want to use SuperTokens, you can simply prov
// Import http from the SuperTokens package
import 'package:supertokens_flutter/http.dart' as http;
Future<void> makeRequest() {
Future<void> makeRequest() async {
Uri uri = Uri.parse("http://localhost:3001/api");
// Initialise your custom client
var customClient = http.Client();
// provide your custom client to SuperTokens
var httpClient = http.Client(client: customClient)
var httpClient = http.Client(client: customClient);
var response = await httpClient.get(uri);
// handle response
Expand All @@ -250,6 +252,7 @@ Use the extension method provided by the SuperTokens SDK to enable interception

```dart
import 'package:supertokens_flutter/dio.dart';
import 'package:dio/dio.dart';
void setup() {
Dio dio = Dio(); // Create a Dio instance.
Expand All @@ -263,9 +266,12 @@ You can make requests as you normally would with `dio`.

```dart
import 'package:supertokens_flutter/dio.dart';
import 'package:dio/dio.dart';
void setup() {
Dio dio = Dio(...)
Dio dio = Dio(
// Provide your config here
);
dio.addSupertokensInterceptor();
var response = dio.get("http://localhost:3001/api");
Expand Down

0 comments on commit d204a40

Please sign in to comment.