flutter-plugin icon indicating copy to clipboard operation
flutter-plugin copied to clipboard

[v2.0.0] Google Pay button ignores provided height

Open kamil-matula opened this issue 10 months ago • 0 comments

Hey, guys! I have recently upgraded library from v1.1.2 to v2.0.0 (pay_android: 2.0.0, pay_ios: 1.0.11 and pay_platform_interface: 1.0.4, according to my pubspec.lock file) and spotted that height of Google Pay button is not the same as it was. After small investigation it turned out that, although I'm setting property's value to 120, its value is still equal to defaultButtonHeight, which is 48, and additional 120-48=72 are added below the button. What's weird, Apple Pay button is not affected by this issue:

Here's part of my code:

import 'package:pay/pay.dart' as pay;
...
return methodType == PaymentTypes.google
    ? pay.GooglePayButton(
        width: double.infinity,
        height: 120,
        cornerRadius: 15,
        type: pay.GooglePayButtonType.pay,
        theme: pay.GooglePayButtonTheme.light,
        paymentConfiguration: gPayConfiguration,
        paymentItems: [paymentItem],
        onPaymentResult: _onPayClick,
        loadingIndicator: _indicatorButton(),
        childOnError: _errorButton('Google Pay'),
        onError: _onError,
      )
    : pay.ApplePayButton(
        width: double.infinity,
        height: 120,
        cornerRadius: 15,
        style: pay.ApplePayButtonStyle.white,
        paymentConfiguration: aPayConfiguration,
        paymentItems: [paymentItem],
        onPaymentResult: _onPayClick,
        loadingIndicator: _indicatorButton(),
        childOnError: _errorButton('Apple Pay'),
        onError: _onError,
      );

I haven't found any issues in library's code yet. Any ideas?

kamil-matula avatar Apr 24 '24 10:04 kamil-matula