qrversions.dart 750 B

1234567891011121314151617181920212223
  1. /*
  2. * QR.Flutter
  3. * Copyright (c) 2019 the QR.Flutter authors.
  4. * See LICENSE for distribution and usage details.
  5. */
  6. /// This class only contains special version codes. QR codes support version
  7. /// numbers from 1-40 and you should just use the numeric version directly.
  8. class QrVersions {
  9. /// Automatically determine the QR code version based on input and an
  10. /// error correction level.
  11. static const int auto = -1;
  12. /// The minimum supported version code.
  13. static const int min = 1;
  14. /// The maximum supported version code.
  15. static const int max = 40;
  16. /// Checks to see if the supplied version is a valid QR code version
  17. static bool isSupportedVersion(int version) =>
  18. version == auto || (version >= min && version <= max);
  19. }