|
|
@@ -20,7 +20,7 @@ import io.flutter.plugin.common.PluginRegistry |
|
|
import io.flutter.plugin.platform.PlatformView |
|
|
import io.flutter.plugin.platform.PlatformView |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QRView(private val context: Context, messenger: BinaryMessenger, private val id: Int, private val params: HashMap<String, Any>) : |
|
|
|
|
|
|
|
|
class QRView(private val context: Context?, messenger: BinaryMessenger, private val id: Int, private val params: HashMap<String, Any>) : |
|
|
PlatformView, MethodChannel.MethodCallHandler, PluginRegistry.RequestPermissionsResultListener { |
|
|
PlatformView, MethodChannel.MethodCallHandler, PluginRegistry.RequestPermissionsResultListener { |
|
|
|
|
|
|
|
|
private var isTorchOn: Boolean = false |
|
|
private var isTorchOn: Boolean = false |
|
|
@@ -279,7 +279,7 @@ class QRView(private val context: Context, messenger: BinaryMessenger, private v |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private fun convertDpToPixels(dp: Double) = |
|
|
private fun convertDpToPixels(dp: Double) = |
|
|
(dp * context.resources.displayMetrics.density).toInt() |
|
|
|
|
|
|
|
|
(dp * context!!.resources.displayMetrics.density).toInt() |
|
|
|
|
|
|
|
|
private fun hasCameraPermission(): Boolean { |
|
|
private fun hasCameraPermission(): Boolean { |
|
|
return permissionGranted || |
|
|
return permissionGranted || |
|
|
|