Navaron Bracke

move enums to src/enums

  1 +export 'src/enums/address_type.dart';
  2 +export 'src/enums/barcode_format.dart';
  3 +export 'src/enums/barcode_type.dart';
1 export 'src/enums/camera_facing.dart'; 4 export 'src/enums/camera_facing.dart';
2 export 'src/enums/detection_speed.dart'; 5 export 'src/enums/detection_speed.dart';
  6 +export 'src/enums/email_type.dart';
  7 +export 'src/enums/encryption_type.dart';
3 export 'src/enums/mobile_scanner_error_code.dart'; 8 export 'src/enums/mobile_scanner_error_code.dart';
4 export 'src/enums/mobile_scanner_state.dart'; 9 export 'src/enums/mobile_scanner_state.dart';
5 -export 'src/enums/ratio.dart'; 10 +export 'src/enums/phone_type.dart';
6 export 'src/enums/torch_state.dart'; 11 export 'src/enums/torch_state.dart';
7 export 'src/mobile_scanner.dart'; 12 export 'src/mobile_scanner.dart';
8 export 'src/mobile_scanner_controller.dart'; 13 export 'src/mobile_scanner_controller.dart';
  1 +/// Address type constants.
  2 +enum AddressType {
  3 + /// Unknown address type.
  4 + ///
  5 + /// Constant Value: 0
  6 + unknown,
  7 +
  8 + /// Work address.
  9 + ///
  10 + /// Constant Value: 1
  11 + work,
  12 +
  13 + /// Home address.
  14 + ///
  15 + /// Constant Value: 2
  16 + home,
  17 +}
  1 +enum BarcodeFormat {
  2 + /// Barcode format unknown to the current SDK.
  3 + ///
  4 + /// Constant Value: -1
  5 + unknown,
  6 +
  7 + /// Barcode format constant representing the union of all supported formats.
  8 + ///
  9 + /// Constant Value: 0
  10 + all,
  11 +
  12 + /// Barcode format constant for Code 128.
  13 + ///
  14 + /// Constant Value: 1
  15 + code128,
  16 +
  17 + /// Barcode format constant for Code 39.
  18 + ///
  19 + /// Constant Value: 2
  20 + code39,
  21 +
  22 + /// Barcode format constant for Code 93.
  23 + ///
  24 + /// Constant Value: 4
  25 + code93,
  26 +
  27 + /// Barcode format constant for Codabar.
  28 + ///
  29 + /// Constant Value: 8
  30 + codebar,
  31 +
  32 + /// Barcode format constant for Data Matrix.
  33 + ///
  34 + /// Constant Value: 16
  35 + dataMatrix,
  36 +
  37 + /// Barcode format constant for EAN-13.
  38 + ///
  39 + /// Constant Value: 32
  40 + ean13,
  41 +
  42 + /// Barcode format constant for EAN-8.
  43 + ///
  44 + /// Constant Value: 64
  45 + ean8,
  46 +
  47 + /// Barcode format constant for ITF (Interleaved Two-of-Five).
  48 + ///
  49 + /// Constant Value: 128
  50 + itf,
  51 +
  52 + /// Barcode format constant for QR Code.
  53 + ///
  54 + /// Constant Value: 256
  55 + qrCode,
  56 +
  57 + /// Barcode format constant for UPC-A.
  58 + ///
  59 + /// Constant Value: 512
  60 + upcA,
  61 +
  62 + /// Barcode format constant for UPC-E.
  63 + ///
  64 + /// Constant Value: 1024
  65 + upcE,
  66 +
  67 + /// Barcode format constant for PDF-417.
  68 + ///
  69 + /// Constant Value: 2048
  70 + pdf417,
  71 +
  72 + /// Barcode format constant for AZTEC.
  73 + ///
  74 + /// Constant Value: 4096
  75 + aztec,
  76 +}
  77 +
  78 +extension BarcodeValue on BarcodeFormat {
  79 + int get rawValue {
  80 + switch (this) {
  81 + case BarcodeFormat.unknown:
  82 + return -1;
  83 + case BarcodeFormat.all:
  84 + return 0;
  85 + case BarcodeFormat.code128:
  86 + return 1;
  87 + case BarcodeFormat.code39:
  88 + return 2;
  89 + case BarcodeFormat.code93:
  90 + return 4;
  91 + case BarcodeFormat.codebar:
  92 + return 8;
  93 + case BarcodeFormat.dataMatrix:
  94 + return 16;
  95 + case BarcodeFormat.ean13:
  96 + return 32;
  97 + case BarcodeFormat.ean8:
  98 + return 64;
  99 + case BarcodeFormat.itf:
  100 + return 128;
  101 + case BarcodeFormat.qrCode:
  102 + return 256;
  103 + case BarcodeFormat.upcA:
  104 + return 512;
  105 + case BarcodeFormat.upcE:
  106 + return 1024;
  107 + case BarcodeFormat.pdf417:
  108 + return 2048;
  109 + case BarcodeFormat.aztec:
  110 + return 4096;
  111 + }
  112 + }
  113 +}
  1 +/// Barcode value type constants
  2 +enum BarcodeType {
  3 + /// Barcode value type unknown, which indicates the current version of SDK cannot recognize the structure of the barcode. Developers can inspect the raw value instead.
  4 + ///
  5 + /// Constant Value: 0
  6 + unknown,
  7 +
  8 + /// Barcode value type constant for contact information.
  9 + ///
  10 + /// Constant Value: 1
  11 + contactInfo,
  12 +
  13 + /// Barcode value type constant for email message details.
  14 + ///
  15 + /// Constant Value: 2
  16 + email,
  17 +
  18 + /// Barcode value type constant for ISBNs.
  19 + ///
  20 + /// Constant Value: 3
  21 + isbn,
  22 +
  23 + /// Barcode value type constant for phone numbers.
  24 + ///
  25 + /// Constant Value: 4
  26 + phone,
  27 +
  28 + /// Barcode value type constant for product codes.
  29 + ///
  30 + /// Constant Value: 5
  31 + product,
  32 +
  33 + /// Barcode value type constant for SMS details.
  34 + ///
  35 + /// Constant Value: 6
  36 + sms,
  37 +
  38 + /// Barcode value type constant for plain text.
  39 + ///
  40 + ///Constant Value: 7
  41 + text,
  42 +
  43 + /// Barcode value type constant for URLs/bookmarks.
  44 + ///
  45 + /// Constant Value: 8
  46 + url,
  47 +
  48 + /// Barcode value type constant for WiFi access point details.
  49 + ///
  50 + /// Constant Value: 9
  51 + wifi,
  52 +
  53 + /// Barcode value type constant for geographic coordinates.
  54 + ///
  55 + /// Constant Value: 10
  56 + geo,
  57 +
  58 + /// Barcode value type constant for calendar events.
  59 + ///
  60 + /// Constant Value: 11
  61 + calendarEvent,
  62 +
  63 + /// Barcode value type constant for driver's license data.
  64 + ///
  65 + /// Constant Value: 12
  66 + driverLicense,
  67 +}
  1 +/// Email format type constants.
  2 +enum EmailType {
  3 + /// Unknown email type.
  4 + ///
  5 + /// Constant Value: 0
  6 + unknown,
  7 +
  8 + /// Work email.
  9 + ///
  10 + /// Constant Value: 1
  11 + work,
  12 +
  13 + /// Home email.
  14 + ///
  15 + /// Constant Value: 2
  16 + home,
  17 +}
  1 +/// Wifi encryption type constants.
  2 +enum EncryptionType {
  3 + /// Unknown encryption type.
  4 + ///
  5 + /// Constant Value: 0
  6 + none,
  7 +
  8 + /// Not encrypted.
  9 + ///
  10 + /// Constant Value: 1
  11 + open,
  12 +
  13 + /// WPA level encryption.
  14 + ///
  15 + /// Constant Value: 2
  16 + wpa,
  17 +
  18 + /// WEP level encryption.
  19 + ///
  20 + /// Constant Value: 3
  21 + wep,
  22 +}
  1 +/// Phone number format type constants.
  2 +enum PhoneType {
  3 + /// Unknown phone type.
  4 + ///
  5 + /// Constant Value: 0
  6 + unknown,
  7 +
  8 + /// Work phone.
  9 + ///
  10 + /// Constant Value: 1
  11 + work,
  12 +
  13 + /// Home phone.
  14 + ///
  15 + /// Constant Value: 2
  16 + home,
  17 +
  18 + /// Fax machine.
  19 + ///
  20 + /// Constant Value: 3
  21 + fax,
  22 +
  23 + /// Mobile phone.
  24 + ///
  25 + /// Constant Value: 4
  26 + mobile,
  27 +}
@@ -500,272 +500,3 @@ class WiFi { @@ -500,272 +500,3 @@ class WiFi {
500 ssid = data['ssid'] as String?, 500 ssid = data['ssid'] as String?,
501 password = data['password'] as String?; 501 password = data['password'] as String?;
502 } 502 }
503 -  
504 -enum BarcodeFormat {  
505 - /// Barcode format unknown to the current SDK.  
506 - ///  
507 - /// Constant Value: -1  
508 - unknown,  
509 -  
510 - /// Barcode format constant representing the union of all supported formats.  
511 - ///  
512 - /// Constant Value: 0  
513 - all,  
514 -  
515 - /// Barcode format constant for Code 128.  
516 - ///  
517 - /// Constant Value: 1  
518 - code128,  
519 -  
520 - /// Barcode format constant for Code 39.  
521 - ///  
522 - /// Constant Value: 2  
523 - code39,  
524 -  
525 - /// Barcode format constant for Code 93.  
526 - ///  
527 - /// Constant Value: 4  
528 - code93,  
529 -  
530 - /// Barcode format constant for Codabar.  
531 - ///  
532 - /// Constant Value: 8  
533 - codebar,  
534 -  
535 - /// Barcode format constant for Data Matrix.  
536 - ///  
537 - /// Constant Value: 16  
538 - dataMatrix,  
539 -  
540 - /// Barcode format constant for EAN-13.  
541 - ///  
542 - /// Constant Value: 32  
543 - ean13,  
544 -  
545 - /// Barcode format constant for EAN-8.  
546 - ///  
547 - /// Constant Value: 64  
548 - ean8,  
549 -  
550 - /// Barcode format constant for ITF (Interleaved Two-of-Five).  
551 - ///  
552 - /// Constant Value: 128  
553 - itf,  
554 -  
555 - /// Barcode format constant for QR Code.  
556 - ///  
557 - /// Constant Value: 256  
558 - qrCode,  
559 -  
560 - /// Barcode format constant for UPC-A.  
561 - ///  
562 - /// Constant Value: 512  
563 - upcA,  
564 -  
565 - /// Barcode format constant for UPC-E.  
566 - ///  
567 - /// Constant Value: 1024  
568 - upcE,  
569 -  
570 - /// Barcode format constant for PDF-417.  
571 - ///  
572 - /// Constant Value: 2048  
573 - pdf417,  
574 -  
575 - /// Barcode format constant for AZTEC.  
576 - ///  
577 - /// Constant Value: 4096  
578 - aztec,  
579 -}  
580 -  
581 -extension BarcodeValue on BarcodeFormat {  
582 - int get rawValue {  
583 - switch (this) {  
584 - case BarcodeFormat.unknown:  
585 - return -1;  
586 - case BarcodeFormat.all:  
587 - return 0;  
588 - case BarcodeFormat.code128:  
589 - return 1;  
590 - case BarcodeFormat.code39:  
591 - return 2;  
592 - case BarcodeFormat.code93:  
593 - return 4;  
594 - case BarcodeFormat.codebar:  
595 - return 8;  
596 - case BarcodeFormat.dataMatrix:  
597 - return 16;  
598 - case BarcodeFormat.ean13:  
599 - return 32;  
600 - case BarcodeFormat.ean8:  
601 - return 64;  
602 - case BarcodeFormat.itf:  
603 - return 128;  
604 - case BarcodeFormat.qrCode:  
605 - return 256;  
606 - case BarcodeFormat.upcA:  
607 - return 512;  
608 - case BarcodeFormat.upcE:  
609 - return 1024;  
610 - case BarcodeFormat.pdf417:  
611 - return 2048;  
612 - case BarcodeFormat.aztec:  
613 - return 4096;  
614 - }  
615 - }  
616 -}  
617 -  
618 -/// Address type constants.  
619 -enum AddressType {  
620 - /// Unknown address type.  
621 - ///  
622 - /// Constant Value: 0  
623 - unknown,  
624 -  
625 - /// Work address.  
626 - ///  
627 - /// Constant Value: 1  
628 - work,  
629 -  
630 - /// Home address.  
631 - ///  
632 - /// Constant Value: 2  
633 - home,  
634 -}  
635 -  
636 -/// Barcode value type constants  
637 -enum BarcodeType {  
638 - /// Barcode value type unknown, which indicates the current version of SDK cannot recognize the structure of the barcode. Developers can inspect the raw value instead.  
639 - ///  
640 - /// Constant Value: 0  
641 - unknown,  
642 -  
643 - /// Barcode value type constant for contact information.  
644 - ///  
645 - /// Constant Value: 1  
646 - contactInfo,  
647 -  
648 - /// Barcode value type constant for email message details.  
649 - ///  
650 - /// Constant Value: 2  
651 - email,  
652 -  
653 - /// Barcode value type constant for ISBNs.  
654 - ///  
655 - /// Constant Value: 3  
656 - isbn,  
657 -  
658 - /// Barcode value type constant for phone numbers.  
659 - ///  
660 - /// Constant Value: 4  
661 - phone,  
662 -  
663 - /// Barcode value type constant for product codes.  
664 - ///  
665 - /// Constant Value: 5  
666 - product,  
667 -  
668 - /// Barcode value type constant for SMS details.  
669 - ///  
670 - /// Constant Value: 6  
671 - sms,  
672 -  
673 - /// Barcode value type constant for plain text.  
674 - ///  
675 - ///Constant Value: 7  
676 - text,  
677 -  
678 - /// Barcode value type constant for URLs/bookmarks.  
679 - ///  
680 - /// Constant Value: 8  
681 - url,  
682 -  
683 - /// Barcode value type constant for WiFi access point details.  
684 - ///  
685 - /// Constant Value: 9  
686 - wifi,  
687 -  
688 - /// Barcode value type constant for geographic coordinates.  
689 - ///  
690 - /// Constant Value: 10  
691 - geo,  
692 -  
693 - /// Barcode value type constant for calendar events.  
694 - ///  
695 - /// Constant Value: 11  
696 - calendarEvent,  
697 -  
698 - /// Barcode value type constant for driver's license data.  
699 - ///  
700 - /// Constant Value: 12  
701 - driverLicense,  
702 -}  
703 -  
704 -/// Email format type constants.  
705 -enum EmailType {  
706 - /// Unknown email type.  
707 - ///  
708 - /// Constant Value: 0  
709 - unknown,  
710 -  
711 - /// Work email.  
712 - ///  
713 - /// Constant Value: 1  
714 - work,  
715 -  
716 - /// Home email.  
717 - ///  
718 - /// Constant Value: 2  
719 - home,  
720 -}  
721 -  
722 -/// Phone number format type constants.  
723 -enum PhoneType {  
724 - /// Unknown phone type.  
725 - ///  
726 - /// Constant Value: 0  
727 - unknown,  
728 -  
729 - /// Work phone.  
730 - ///  
731 - /// Constant Value: 1  
732 - work,  
733 -  
734 - /// Home phone.  
735 - ///  
736 - /// Constant Value: 2  
737 - home,  
738 -  
739 - /// Fax machine.  
740 - ///  
741 - /// Constant Value: 3  
742 - fax,  
743 -  
744 - /// Mobile phone.  
745 - ///  
746 - /// Constant Value: 4  
747 - mobile,  
748 -}  
749 -  
750 -/// Wifi encryption type constants.  
751 -enum EncryptionType {  
752 - /// Unknown encryption type.  
753 - ///  
754 - /// Constant Value: 0  
755 - none,  
756 -  
757 - /// Not encrypted.  
758 - ///  
759 - /// Constant Value: 1  
760 - open,  
761 -  
762 - /// WPA level encryption.  
763 - ///  
764 - /// Constant Value: 2  
765 - wpa,  
766 -  
767 - /// WEP level encryption.  
768 - ///  
769 - /// Constant Value: 3  
770 - wep,  
771 -}