juliuscanute / qr_code_scanner

QR Code Scanner for Flutter
BSD 2-Clause "Simplified" License
1.02k stars 816 forks source link

[FEATURE] It will be nice if we will be able to get parsed result also. #301

Open 2shrestha22 opened 3 years ago

2shrestha22 commented 3 years ago

Currently scan result only gives code and format. But getting type of result like URL, E-Mail, vCard will be useful.

Firebase ML Vision already have this type of feature;

for (Barcode barcode in barcodes) {
  final Rectangle<int> boundingBox = barcode.boundingBox;
  final List<Point<int>> cornerPoints = barcode.cornerPoints;

  final String rawValue = barcode.rawValue;

  final BarcodeValueType valueType = barcode.valueType;

  // See API reference for complete list of supported types
  switch (valueType) {
    case BarcodeValueType.wifi:
      final String ssid = barcode.wifi.ssid;
      final String password = barcode.wifi.password;
      final BarcodeWiFiEncryptionType type = barcode.wifi.encryptionType;
      break;
    case BarcodeValueType.url:
      final String title = barcode.url.title;
      final String url = barcode.url.url;
      break;
  }
}

https://github.com/zxing/zxing/wiki/Barcode-Contents

For now, would you give me some hint for converting raw data to more readable data type like above?

juliansteenbakker commented 3 years ago

I think its best to this with the new MLKit integration since the library currently used for the QRView is deprecated.