Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compile errors for flutter beta #654

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class StripeAubecsDebitPlatformViewFactory(
private val sdkAccessor: () -> StripeSdkModule
) : PlatformViewFactory(StandardMessageCodec.INSTANCE) {

override fun create(context: Context, viewId: Int, args: Any?): PlatformView {
override fun create(context: Context?, viewId: Int, args: Any?): PlatformView {
val channel = MethodChannel(flutterPluginBinding.binaryMessenger, "flutter.stripe/aubecs_form_field/${viewId}")
val creationParams = args as? Map<String?, Any?>?
return StripeAubecsDebitPlatformView(context, channel, viewId, creationParams, auBECSDebitFormViewManager, sdkAccessor)
return StripeAubecsDebitPlatformView(context!!, channel, viewId, creationParams, auBECSDebitFormViewManager, sdkAccessor)
Copy link
Member

@remonh87 remonh87 Mar 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonasbark I am not convinced of using !! here. When we integrate a fix I think we should handle a nullable context in the platform views itself + provide a meaningful error message. What do you think?

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class StripeSdkCardFormPlatformViewFactory(
private val sdkAccessor: () -> StripeSdkModule
) : PlatformViewFactory(StandardMessageCodec.INSTANCE) {

override fun create(context: Context, viewId: Int, args: Any?): PlatformView {
override fun create(context: Context?, viewId: Int, args: Any?): PlatformView {
val channel = MethodChannel(flutterPluginBinding.binaryMessenger, "flutter.stripe/card_form_field/${viewId}")
val creationParams = args as? Map<String?, Any?>?
return StripeSdkCardFormPlatformView(context, channel, viewId, creationParams, cardFormViewManager, sdkAccessor)
return StripeSdkCardFormPlatformView(context!!, channel, viewId, creationParams, cardFormViewManager, sdkAccessor)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class StripeSdkCardPlatformViewFactory(
private val sdkAccessor: () -> StripeSdkModule
) : PlatformViewFactory(StandardMessageCodec.INSTANCE) {

override fun create(context: Context, viewId: Int, args: Any?): PlatformView {
override fun create(context: Context?, viewId: Int, args: Any?): PlatformView {
val channel = MethodChannel(flutterPluginBinding.binaryMessenger, "flutter.stripe/card_field/${viewId}")
val creationParams = args as? Map<String?, Any?>?
return StripeSdkCardPlatformView(context, channel, viewId, creationParams, stripeSdkCardViewManager, sdkAccessor)
return StripeSdkCardPlatformView(context!!, channel, viewId, creationParams, stripeSdkCardViewManager, sdkAccessor)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class StripeSdkGooglePayButtonPlatformViewFactory(
private val sdkAccessor: () -> StripeSdkModule
) : PlatformViewFactory(StandardMessageCodec.INSTANCE) {

override fun create(context: Context, viewId: Int, args: Any?): PlatformView {
override fun create(context: Context?, viewId: Int, args: Any?): PlatformView {
val channel = MethodChannel(flutterPluginBinding.binaryMessenger, "flutter.stripe/google_pay_button/${viewId}")
val creationParams = args as? Map<String?, Any?>?
return StripeSdkGooglePayButtonPlatformView(context, channel, viewId, creationParams, payButtonManager, sdkAccessor)
return StripeSdkGooglePayButtonPlatformView(context!!, channel, viewId, creationParams, payButtonManager, sdkAccessor)
}

}