Skip to content

Commit

Permalink
refactor: Changed OAuthProvider extension to unnamed only for private (
Browse files Browse the repository at this point in the history
…#66)

* Refactor to unnamed extension for private

- ref. https://dart.dev/language/extension-methods#unnamed-extensions

* Remove unnecessary prefix underscore
  • Loading branch information
htsuruo authored Jan 7, 2024
1 parent bddb324 commit edd83a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/src/components/supa_socials_auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:supabase_auth_ui/src/utils/constants.dart';
import 'package:supabase_flutter/supabase_flutter.dart';

extension SocialProvidersa on OAuthProvider {
IconData get _iconData => switch (this) {
extension on OAuthProvider {
IconData get iconData => switch (this) {
OAuthProvider.apple => FontAwesomeIcons.apple,
OAuthProvider.azure => FontAwesomeIcons.microsoft,
OAuthProvider.bitbucket => FontAwesomeIcons.bitbucket,
Expand All @@ -24,7 +24,7 @@ extension SocialProvidersa on OAuthProvider {
_ => Icons.close,
};

Color get _btnBgColor => switch (this) {
Color get btnBgColor => switch (this) {
OAuthProvider.apple => Colors.black,
OAuthProvider.azure => Colors.blueAccent,
OAuthProvider.bitbucket => Colors.blue,
Expand Down Expand Up @@ -139,7 +139,7 @@ class _SupaSocialsAuthState extends State<SupaSocialsAuth> {
final socialProvider = providers[index];

Color? foregroundColor = coloredBg ? Colors.white : null;
Color? backgroundColor = coloredBg ? socialProvider._btnBgColor : null;
Color? backgroundColor = coloredBg ? socialProvider.btnBgColor : null;
Color? overlayColor = coloredBg ? Colors.white10 : null;

Color? iconColor = coloredBg ? Colors.white : null;
Expand All @@ -148,7 +148,7 @@ class _SupaSocialsAuthState extends State<SupaSocialsAuth> {
height: 48,
width: 48,
child: Icon(
socialProvider._iconData,
socialProvider.iconData,
color: iconColor,
),
);
Expand Down

0 comments on commit edd83a2

Please sign in to comment.