From fd0b815dbf82327caa9867dfe4b72571cc1bfe9a Mon Sep 17 00:00:00 2001 From: Rexios Date: Thu, 24 Nov 2022 08:19:09 -0500 Subject: [PATCH] feat: [firebase_ui_auth] [firebase_ui_oauth] Allow for custom labels to be used for custom OAuth providers (#9858) * Added `label` field to `ThemedOAuthProviderButtonStyle` * Added comment * Code simplification * Formatting * Removed dependency overrides --- .../lib/src/widgets/internal/oauth_provider_button.dart | 3 ++- .../lib/src/oauth_provider_button_style.dart | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/firebase_ui_auth/lib/src/widgets/internal/oauth_provider_button.dart b/packages/firebase_ui_auth/lib/src/widgets/internal/oauth_provider_button.dart index 5f737e8e18cb..74209d3a264f 100644 --- a/packages/firebase_ui_auth/lib/src/widgets/internal/oauth_provider_button.dart +++ b/packages/firebase_ui_auth/lib/src/widgets/internal/oauth_provider_button.dart @@ -110,7 +110,8 @@ class OAuthProviderButton extends StatelessWidget { ), label: variant == OAuthButtonVariant.icon ? '' - : resolveProviderButtonLabel(provider.providerId, labels), + : provider.style.label ?? + resolveProviderButtonLabel(provider.providerId, labels), auth: auth, ); diff --git a/packages/firebase_ui_oauth/lib/src/oauth_provider_button_style.dart b/packages/firebase_ui_oauth/lib/src/oauth_provider_button_style.dart index f01ab565e459..078fa19e5f99 100644 --- a/packages/firebase_ui_oauth/lib/src/oauth_provider_button_style.dart +++ b/packages/firebase_ui_oauth/lib/src/oauth_provider_button_style.dart @@ -46,6 +46,11 @@ abstract class ThemedOAuthProviderButtonStyle { double get iconPadding => 0; String get assetsPackage; + /// A custom label string. + /// + /// Required for custom OAuth providers. + String? get label => null; + /// {@macro ui.oauth.themed_oauth_provider_button_style} const ThemedOAuthProviderButtonStyle();