flutter-stripe / flutter_stripe

Flutter SDK for Stripe.
https://pub.dev/packages/flutter_stripe
948 stars 524 forks source link

Dark Theme Issues: Light Modal Background and Dark Close Button (Android) #1902

Closed kherel closed 1 month ago

kherel commented 2 months ago

Describe the bug

I am using the dark theme in my app, but I am encountering the following issues:

The modalBackgroundColor appears light instead of dark. The close button is dark, which makes it hard to see on the dark background.

To Reproduce

Steps to reproduce the behavior: use Android Emulator

await Stripe.instance.initPaymentSheet(
  paymentSheetParameters: SetupPaymentSheetParameters(
    paymentIntentClientSecret: checkoutId,
    merchantDisplayName: 'Ticketsouq',
    primaryButtonLabel: 'Pay now',
    style: ThemeMode.dark,
    appearance: PaymentSheetAppearance(
      colors: PaymentSheetAppearanceColors(
        background: BrandColors.background,
        primary: BrandColors.purple,
        primaryText: Colors.white,
        secondaryText: Colors.white,
        componentBackground: BrandColors.white,
        componentBorder: BrandColors.white,
      ),
      shapes: PaymentSheetShape(
        borderWidth: 1,
        shadow: PaymentSheetShadowParams(color: BrandColors.background),
      ),
      primaryButton: PaymentSheetPrimaryButtonAppearance(
        shapes: PaymentSheetPrimaryButtonShape(blurRadius: 8),
        colors: PaymentSheetPrimaryButtonTheme(
          dark: PaymentSheetPrimaryButtonThemeColors(
            background: BrandColors.background,
            text: Colors.white,
            border: BrandColors.purple,
          ),
        ),

      ),

    ),
  ),
);
 await Stripe.instance.presentPaymentSheet();
Screenshot 2024-08-26 at 18 58 12
remonh87 commented 2 months ago

if you remove the paymentsheet appearance the color will be dark or light depending on your preferences. I would playaround a bit with your config there and see which settings are causing this behavior. The default sheet looks good on android dark

kherel commented 1 month ago

thanks