Skip to content

Commit

Permalink
Fix #1861 (#1900)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbark authored Aug 25, 2024
1 parent aa4e9a2 commit c22a92f
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ class StripeSdkGooglePayButtonPlatformView(
googlePayButtonManager.borderRadius(payButton, creationParams["borderRadius"] as Int)
}
payButton.initialize()
payButton.getChildAt(0).setOnClickListener {
channel.invokeMethod("onPressed", null)
}
}

override fun getView(): View {
Expand All @@ -53,5 +50,12 @@ class StripeSdkGooglePayButtonPlatformView(

override fun onFlutterViewAttached(flutterView: View) {
googlePayButtonManager.onAfterUpdateTransaction(payButton)

// wait until view is attached to the view hierarchy
payButton.post {
(payButton.parent as View).setOnClickListener {
channel.invokeMethod("onPressed", null)
}
};
}
}

0 comments on commit c22a92f

Please sign in to comment.