flutter_mrz_scanner icon indicating copy to clipboard operation
flutter_mrz_scanner copied to clipboard

'MRZScannerFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView

Open Kolloshe opened this issue 2 years ago • 3 comments

Class 'MRZScannerFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory

flutter_mrz_scanner-2.0.0/android/src/main/kotlin/io/github/olexale/flutter_mrz_scanner/FlutterMrzScannerPlugin.kt: (30, 5): 'create' overrides nothing

Kolloshe avatar Jun 29 '22 10:06 Kolloshe

facing the same issue with Flutter 3

sahil-innostax avatar Jul 05 '22 13:07 sahil-innostax

It's error from null safety of kotlin

please try below in FlutterMrzScannerPlugin.kt

class MRZScannerFactory(private val messenger: BinaryMessenger) : PlatformViewFactory(StandardMessageCodec.INSTANCE) {

override fun create(context: Context?, id: Int, o: Any?): PlatformView {
    return MRZScannerView(context!!, messenger, id)
}

}

Attention Context? context!!

From detail, you can see PlatformViewFactory source code:

public abstract PlatformView create(@Nullable Context context, int viewId, @Nullable Object args);

beratpolat avatar Jul 15 '22 21:07 beratpolat

Class 'MRZScannerFactory' is not abstract and does not implement abstract base class member public abstract fun create(p0: Context?, p1: Int, p2: Any?): PlatformView defined in io.flutter.plugin.platform.PlatformViewFactory

.pub-cache/hosted/pub.dartlang.org/flutter_mrz_scanner-2.0.0/android/src/main/kotlin/io/github/olexale/flutter_mrz_scanner/FlutterMrzScannerPlugin.kt: (30, 5): 'create' overrides nothing

msalmancode avatar Aug 16 '22 11:08 msalmancode