rename SwiftMobileScannerPlugin to MobileScannerPlugin to match MacOS
Showing
1 changed file
with
6 additions
and
6 deletions
| @@ -4,7 +4,7 @@ import MLKitBarcodeScanning | @@ -4,7 +4,7 @@ import MLKitBarcodeScanning | ||
| 4 | import AVFoundation | 4 | import AVFoundation |
| 5 | import UIKit | 5 | import UIKit |
| 6 | 6 | ||
| 7 | -public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin { | 7 | +public class MobileScannerPlugin: NSObject, FlutterPlugin { |
| 8 | 8 | ||
| 9 | /// The mobile scanner object that handles all logic | 9 | /// The mobile scanner object that handles all logic |
| 10 | private let mobileScanner: MobileScanner | 10 | private let mobileScanner: MobileScanner |
| @@ -16,7 +16,7 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin { | @@ -16,7 +16,7 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin { | ||
| 16 | static var scanWindow: [CGFloat]? | 16 | static var scanWindow: [CGFloat]? |
| 17 | 17 | ||
| 18 | private static func isBarcodeInScanWindow(barcode: Barcode, imageSize: CGSize) -> Bool { | 18 | private static func isBarcodeInScanWindow(barcode: Barcode, imageSize: CGSize) -> Bool { |
| 19 | - let scanwindow = SwiftMobileScannerPlugin.scanWindow! | 19 | + let scanwindow = MobileScannerPlugin.scanWindow! |
| 20 | let barcodeminX = barcode.cornerPoints![0].cgPointValue.x | 20 | let barcodeminX = barcode.cornerPoints![0].cgPointValue.x |
| 21 | let barcodeminY = barcode.cornerPoints![1].cgPointValue.y | 21 | let barcodeminY = barcode.cornerPoints![1].cgPointValue.y |
| 22 | 22 | ||
| @@ -39,8 +39,8 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin { | @@ -39,8 +39,8 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin { | ||
| 39 | self.mobileScanner = MobileScanner(registry: registry, mobileScannerCallback: { barcodes, error, image in | 39 | self.mobileScanner = MobileScanner(registry: registry, mobileScannerCallback: { barcodes, error, image in |
| 40 | if barcodes != nil { | 40 | if barcodes != nil { |
| 41 | let barcodesMap: [Any?] = barcodes!.compactMap { barcode in | 41 | let barcodesMap: [Any?] = barcodes!.compactMap { barcode in |
| 42 | - if (SwiftMobileScannerPlugin.scanWindow != nil) { | ||
| 43 | - if (SwiftMobileScannerPlugin.isBarcodeInScanWindow(barcode: barcode, imageSize: image.size)) { | 42 | + if (MobileScannerPlugin.scanWindow != nil) { |
| 43 | + if (MobileScannerPlugin.isBarcodeInScanWindow(barcode: barcode, imageSize: image.size)) { | ||
| 44 | return barcode.data | 44 | return barcode.data |
| 45 | } else { | 45 | } else { |
| 46 | return nil | 46 | return nil |
| @@ -66,7 +66,7 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin { | @@ -66,7 +66,7 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin { | ||
| 66 | 66 | ||
| 67 | public static func register(with registrar: FlutterPluginRegistrar) { | 67 | public static func register(with registrar: FlutterPluginRegistrar) { |
| 68 | let channel = FlutterMethodChannel(name: "dev.steenbakker.mobile_scanner/scanner/method", binaryMessenger: registrar.messenger()) | 68 | let channel = FlutterMethodChannel(name: "dev.steenbakker.mobile_scanner/scanner/method", binaryMessenger: registrar.messenger()) |
| 69 | - let instance = SwiftMobileScannerPlugin(barcodeHandler: BarcodeHandler(registrar: registrar), registry: registrar.textures()) | 69 | + let instance = MobileScannerPlugin(barcodeHandler: BarcodeHandler(registrar: registrar), registry: registrar.textures()) |
| 70 | registrar.addMethodCallDelegate(instance, channel: channel) | 70 | registrar.addMethodCallDelegate(instance, channel: channel) |
| 71 | } | 71 | } |
| 72 | 72 | ||
| @@ -216,7 +216,7 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin { | @@ -216,7 +216,7 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin { | ||
| 216 | /// Toggles the torch | 216 | /// Toggles the torch |
| 217 | func updateScanWindow(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) { | 217 | func updateScanWindow(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) { |
| 218 | let scanWindowData: Array? = (call.arguments as? [String: Any])?["rect"] as? [CGFloat] | 218 | let scanWindowData: Array? = (call.arguments as? [String: Any])?["rect"] as? [CGFloat] |
| 219 | - SwiftMobileScannerPlugin.scanWindow = scanWindowData | 219 | + MobileScannerPlugin.scanWindow = scanWindowData |
| 220 | 220 | ||
| 221 | result(nil) | 221 | result(nil) |
| 222 | } | 222 | } |
-
Please register or login to post a comment