message property

String get message

Returns a human-readable error message for the given MobileScannerErrorCode.

Implementation

String get message {
  switch (this) {
    case MobileScannerErrorCode.controllerUninitialized:
      return 'The MobileScannerController has not been initialized. '
          'Call start() before using it.';
    case MobileScannerErrorCode.permissionDenied:
      return 'Camera permission denied.';
    case MobileScannerErrorCode.unsupported:
      return 'Scanning is not supported on this device.';
    case MobileScannerErrorCode.controllerAlreadyInitialized:
      return 'The MobileScannerController is already running. '
          'Stop it before starting again.';
    case MobileScannerErrorCode.controllerDisposed:
      return 'The MobileScannerController was used after it was disposed.';
    case MobileScannerErrorCode.controllerInitializing:
      return 'The MobileScannerController is still initializing. '
          'Await the previous call to start() or disable autoStart before '
          'starting manually.';
    case MobileScannerErrorCode.genericError:
      return 'An unexpected error occurred.';
    case MobileScannerErrorCode.controllerNotAttached:
      return 'The MobileScannerController has not been attached to '
          'MobileScanner. Call start() after the MobileScanner widget is '
          'built.';
  }
}