Skip to content

Commit 63bda04

Browse files
committed
fix: #2224 incorrect google pay params
1 parent b4dbe8f commit 63bda04

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

example/lib/screens/wallets/google_pay_stripe_screen.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class _GooglePayStripeScreenState extends State<GooglePayStripeScreen> {
100100
SizedBox(
101101
height: 75,
102102
child: PlatformPayButton(
103+
borderRadius: 24,
103104
type: PlatformButtonType.buy,
104105
onPressed: () {
105106
startGooglePay();

packages/stripe/lib/src/widgets/google_pay_button.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ class _GooglePayButtonState extends State<GooglePayButton> {
3838
void initState() {
3939
// ignore: deprecated_member_use_from_same_package
4040
_creationParams['buttonType'] = widget.type.name;
41-
_creationParams['type'] = widget.buttonType.id;
42-
_creationParams['appearance'] = widget.appearance.id;
43-
_creationParams['borderRadius'] = widget.borderRadius;
41+
_creationParams['type'] = widget.buttonType.id.toDouble();
42+
_creationParams['appearance'] = widget.appearance.id.toDouble();
43+
_creationParams['borderRadius'] = widget.borderRadius?.toDouble();
4444
super.initState();
4545
}
4646

@@ -67,12 +67,12 @@ class _GooglePayButtonState extends State<GooglePayButton> {
6767
onCreatePlatformView: (params) {
6868
onPlatformViewCreated(params.id);
6969
return PlatformViewsService.initExpensiveAndroidView(
70-
id: params.id,
71-
viewType: GooglePayButton._viewType,
72-
layoutDirection: TextDirection.ltr,
73-
creationParams: _creationParams,
74-
creationParamsCodec: const StandardMessageCodec(),
75-
)
70+
id: params.id,
71+
viewType: GooglePayButton._viewType,
72+
layoutDirection: TextDirection.ltr,
73+
creationParams: _creationParams,
74+
creationParamsCodec: const StandardMessageCodec(),
75+
)
7676
..addOnPlatformViewCreatedListener(params.onPlatformViewCreated)
7777
..create();
7878
},

0 commit comments

Comments
 (0)