Skip to content

Commit 25957a7

Browse files
Update supa_socials_auth.dart to include slackOidc and linkedInOidc mapping options
1 parent 2f38b5d commit 25957a7

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/src/components/supa_socials_auth.dart

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ extension on OAuthProvider {
2424
OAuthProvider.gitlab => FontAwesomeIcons.gitlab,
2525
OAuthProvider.google => FontAwesomeIcons.google,
2626
OAuthProvider.linkedin => FontAwesomeIcons.linkedin,
27+
OAuthProvider.linkedinOidc => FontAwesomeIcons.linkedin,
2728
OAuthProvider.slack => FontAwesomeIcons.slack,
29+
OAuthProvider.slackOidc => FontAwesomeIcons.slack,
2830
OAuthProvider.spotify => FontAwesomeIcons.spotify,
2931
OAuthProvider.twitch => FontAwesomeIcons.twitch,
3032
OAuthProvider.twitter => FontAwesomeIcons.xTwitter,
@@ -44,8 +46,10 @@ extension on OAuthProvider {
4446
OAuthProvider.kakao => const Color(0xFFFFE812),
4547
OAuthProvider.keycloak => const Color.fromRGBO(0, 138, 170, 1),
4648
OAuthProvider.linkedin => const Color.fromRGBO(0, 136, 209, 1),
49+
OAuthProvider.linkedinOidc => const Color.fromRGBO(0, 136, 209, 1),
4750
OAuthProvider.notion => const Color.fromRGBO(69, 75, 78, 1),
4851
OAuthProvider.slack => const Color.fromRGBO(74, 21, 75, 1),
52+
OAuthProvider.slackOidc => const Color.fromRGBO(74, 21, 75, 1),
4953
OAuthProvider.spotify => Colors.green,
5054
OAuthProvider.twitch => Colors.purpleAccent,
5155
OAuthProvider.twitter => Colors.black,
@@ -54,8 +58,13 @@ extension on OAuthProvider {
5458
_ => Colors.black,
5559
};
5660

57-
String get labelText =>
58-
'Continue with ${name[0].toUpperCase()}${name.substring(1)}';
61+
String get capitalizedName {
62+
String modifiedName = name;
63+
if (name.endsWith("Oidc")) {
64+
modifiedName = name.substring(0, name.length - 4);
65+
}
66+
return modifiedName[0].toUpperCase() + modifiedName.substring(1);
67+
}
5968
}
6069

6170
enum SocialButtonVariant {

0 commit comments

Comments
 (0)