Buscar pacotes, repositórios e categorias de apps

Detalhes do pacotev0.1.4

flutter_barcode_listener

Ouvir qualquer escaner de código de barras de hardware sem nenhum SDK do fabricante

AndroidiOSWebmacOSWindowsLinux
Downloads em 30 dias
17,7 mil
Curtidas
183
Pontos Pub
150

Instalar pacote

flutter pub add flutter_barcode_listener

Visão geral do pacote

Orientação gerada a partir de informações públicas. Apenas para referência.

Flutter Barcode Listener é um pacote multiplataforma que permite que aplicativos recebam entrada de qualquer leitor de códigos de barras de hardware sem a necessidade de SDKs específicos do fabricante. Funciona de forma integrada no Android, iOS, Web, macOS, Windows e Linux, detectando dados escaneados por meio de eventos de entrada padrão. O pacote abstrai a complexidade da integração com hardware, tornando fácil implementar funcionalidades de leitura de códigos de barras em sistemas de varejo, gestão de estoque, logística e ponto de venda. Os desenvolvedores podem se concentrar na lógica de negócios em vez de configurações específicas de dispositivo.

Casos de uso

  • rastreamento de estoque varejista
  • Sistemas de ponto de venda
  • Logística e transporte
  • Gestão de ativos
  • Entrada de dados móvel
  • Operações de armazém

Principais recursos

  • Suporte multiplataforma
  • Nenhum SDK do fabricante necessário
  • Detecção automática de entrada
  • API baseada em eventos simples
  • Funciona com qualquer leitor de código de barras USB/Bluetooth
  • Resposta de escaneamento em tempo real

Indicado para

  • Desenvolvedores de aplicativos POS
  • Soluções de gerenciamento de estoque
  • Aplicações de serviço em campo
  • Ferramentas móveis de comércio eletrônico
  • sistemas de coleta de dados empresariais

Considerações

  • Requer hardware de leitor de código de barras físico
  • Pode ser necessário o tratamento de permissões em algumas plataformas
  • Limitado a formatos de código de barras baseados em texto
  • Não adequado para digitalização baseada em câmera
  • Depende do reconhecimento de entrada de nível de sistema
  • O suporte da Web pode variar conforme o navegador

README original

Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.

flutter_barcode_listener

Listen for any hardware barcode scanner

Problems with barcode scanning

If you need to get barcode scanned from some hardware barcode scanner you generally have few ways to do it.

  1. implement some text input control (IE. TextEdit), call focus on it and make the scan
  2. listen for some special system event (IE. intent fired from Android service)
  3. listen for raw keyboard events

First aproach is simple, and if you're ok to catch scanned barcodes only when you have focus on text control you're good to go and you don't need this package.

If you however need to somehow get scanned barcodes even when you don't have focus on text input control (or no text input control at all) you're left with two other options.

Listening for special system events (IE. Anroid service intents) is always tied for specific manufacturer/device that usually comes with some kind of SDK you need to implement. This means you're implementation will support listening barcode scannes only for this devices you implemented. Plus, it's not really cross platform friendly

And there's third way, simply listen for raw keyboard events and figure out what's barcode and what's not. Downside of this solution is that you need to figure out what's actual user interaction and what's barcode scan. Upside is it doesn't require any per manufacturer/device implementation and you're pretty much suporting all barcode scanners, including external ones with bluetooth or wifi. And it's cross platform friendly.

Implementation idea

All hardware barcode devices have few things in common

  • they act as a keyboard when barcode is scanned
  • all keyboard events are fired in extremly small time frame (less than 100 ms between each character)
  • barcode is terminated with special character (enter in majority)

So to figure out what is actual barcode and what is simple keyboard event that should be ignored this package uses following logic

  1. listen for physical keyboard raw key up event
  2. filter out only 'REAL' characters (ASCII codes lower than 256, without special characters except enter)
  3. on each new key check if previous key is older than bufferDuration, if it's older clear internal buffer.
  4. check if new key is enter key, if it is call onBarcodeScanned callback and clear buffer
  5. if it's not enter key just append it to internal buffer;

Basically it translates to: if you get bunch of keys comming really fast that end with enter key it's a BINGO.

Categorias

Repositório-fonte

Projetos que usam este pacote

Ainda não há dados.