Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: create package specific configs (#640)
- Loading branch information
Showing
10 changed files
with
160 additions
and
131 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'package:supabase/supabase.dart'; | ||
|
||
class PostgrestClientOptions { | ||
final String schema; | ||
|
||
const PostgrestClientOptions({this.schema = 'public'}); | ||
} | ||
|
||
class AuthClientOptions { | ||
final bool autoRefreshToken; | ||
final GotrueAsyncStorage? pkceAsyncStorage; | ||
final AuthFlowType authFlowType; | ||
|
||
const AuthClientOptions({ | ||
this.autoRefreshToken = true, | ||
this.pkceAsyncStorage, | ||
this.authFlowType = AuthFlowType.pkce, | ||
}); | ||
} | ||
|
||
class StorageClientOptions { | ||
final int retryAttempts; | ||
|
||
const StorageClientOptions({this.retryAttempts = 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
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
26 changes: 26 additions & 0 deletions
26
packages/supabase_flutter/lib/src/flutter_go_true_client_options.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import 'package:supabase_flutter/supabase_flutter.dart'; | ||
|
||
class FlutterAuthClientOptions extends AuthClientOptions { | ||
final LocalStorage? localStorage; | ||
|
||
const FlutterAuthClientOptions({ | ||
super.authFlowType, | ||
super.autoRefreshToken, | ||
super.pkceAsyncStorage, | ||
this.localStorage, | ||
}); | ||
|
||
FlutterAuthClientOptions copyWith({ | ||
AuthFlowType? authFlowType, | ||
bool? autoRefreshToken, | ||
LocalStorage? localStorage, | ||
dynamic pkceAsyncStorage, | ||
}) { | ||
return FlutterAuthClientOptions( | ||
authFlowType: authFlowType ?? this.authFlowType, | ||
autoRefreshToken: autoRefreshToken ?? this.autoRefreshToken, | ||
localStorage: localStorage ?? this.localStorage, | ||
pkceAsyncStorage: pkceAsyncStorage ?? this.pkceAsyncStorage, | ||
); | ||
} | ||
} |
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.