Skip to content
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

enhancement: allow user to decide launch mode #110

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/src/components/supa_socials_auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ class SupaSocialsAuth extends StatefulWidget {
/// Localization for the form
final SupaSocialsAuthLocalization localization;

/// Custom LaunchMode support
final LaunchMode authScreenLaunchMode;

const SupaSocialsAuth({
super.key,
this.nativeGoogleAuthConfig,
Expand All @@ -139,6 +142,7 @@ class SupaSocialsAuth extends StatefulWidget {
this.scopes,
this.queryParams,
this.localization = const SupaSocialsAuthLocalization(),
this.authScreenLaunchMode = LaunchMode.platformDefault,
});

@override
Expand Down Expand Up @@ -265,7 +269,6 @@ class _SupaSocialsAuthState extends State<SupaSocialsAuth> {
width: 48,
height: 48,
);

foregroundColor = Colors.black;
backgroundColor = Colors.white;
overlayColor = Colors.white;
Expand Down Expand Up @@ -354,6 +357,7 @@ class _SupaSocialsAuthState extends State<SupaSocialsAuth> {
redirectTo: widget.redirectUrl,
scopes: widget.scopes?[socialProvider],
queryParams: widget.queryParams?[socialProvider],
authScreenLaunchMode: widget.authScreenLaunchMode,
);
} on AuthException catch (error) {
if (widget.onError == null && context.mounted) {
Expand Down
Loading