From 49152a78425f8fd721d85a0ba5a71b574456fca7 Mon Sep 17 00:00:00 2001 From: Hemanth Raj V Date: Fri, 1 Mar 2024 19:46:02 +0530 Subject: [PATCH 1/2] fix: respect the text color for card field on web --- packages/stripe_web/lib/src/widgets/card_field.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/stripe_web/lib/src/widgets/card_field.dart b/packages/stripe_web/lib/src/widgets/card_field.dart index adb7a1264..1cf1b004a 100644 --- a/packages/stripe_web/lib/src/widgets/card_field.dart +++ b/packages/stripe_web/lib/src/widgets/card_field.dart @@ -158,7 +158,14 @@ class WebStripeCardState extends State with CardFieldContext { } js.CardElementOptions createOptions() { + final textColor = widget.style?.textColor; return js.CardElementOptions( + style: { + 'base': { + if (textColor != null) + 'color': '${colorToCssString(textColor)}' + } + } hidePostalCode: !widget.enablePostalCode, ); } From 2c86ce51a2e84eac3ef1eb01db4a7902d6512b7a Mon Sep 17 00:00:00 2001 From: Hemanth Raj V Date: Fri, 1 Mar 2024 19:55:42 +0530 Subject: [PATCH 2/2] fix: syntax error --- packages/stripe_web/lib/src/widgets/card_field.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/stripe_web/lib/src/widgets/card_field.dart b/packages/stripe_web/lib/src/widgets/card_field.dart index 1cf1b004a..1d86c59b7 100644 --- a/packages/stripe_web/lib/src/widgets/card_field.dart +++ b/packages/stripe_web/lib/src/widgets/card_field.dart @@ -165,7 +165,7 @@ class WebStripeCardState extends State with CardFieldContext { if (textColor != null) 'color': '${colorToCssString(textColor)}' } - } + }, hidePostalCode: !widget.enablePostalCode, ); }