Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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)
}

}