rfid_zebra_reader 0.0.2 copy "rfid_zebra_reader: ^0.0.2" to clipboard
rfid_zebra_reader: ^0.0.2 copied to clipboard

PlatformAndroid

plugin to interact with Zebra RFID readers

rfid_zebra_reader #

pub package GitHub

A Flutter plugin for seamless integration with Zebra RFID readers. Built specifically for Zebra TC27 and compatible devices, providing real-time tag scanning, antenna power control, and full Android 13+ support.


📦 Installation #

Add to your pubspec.yaml:

dependencies:
  rfid_zebra_reader: ^0.0.2

Then run:

flutter pub get

⚙️ Android Configuration #

IMPORTANT: Add Maven Repository #

The Zebra RFID SDK is hosted on GitHub. You need to add the repository to your app's Gradle configuration.

📘 Kotlin DSL (build.gradle.kts) - Click to expand

If your app uses Kotlin DSL, add this to your_app/android/build.gradle.kts:

allprojects {
    repositories {
        google()
        mavenCentral()
        
        // Add Zebra RFID SDK repository
        maven {
            url = uri("https://raw.githubusercontent.com/devJimmy990/rfid_zebra_reader/main/android/maven")
        }
    }
}
📗 Groovy (build.gradle) - Click to expand

If your app uses Groovy, add this to your_app/android/build.gradle:

allprojects {
    repositories {
        google()
        mavenCentral()
        
        // Add Zebra RFID SDK repository
        maven {
            url "https://raw.githubusercontent.com/devJimmy990/rfid_zebra_reader/main/android/maven"
        }
    }
}

That's it! The plugin will automatically download and configure the Zebra SDK.


🚀 Quick Start #

import 'package:rfid_zebra_reader/rfid_zebra_reader.dart';

// Initialize SDK
await ZebraRfidReader.initialize();

// Listen for tag events
ZebraRfidReader.eventStream.listen((event) {
  if (event.type == RfidEventType.tagRead) {
    print('Tags: ${event.tags}');
  }
});

// Connect to reader
await ZebraRfidReader.connect();

// Start scanning
await ZebraRfidReader.startInventory();

// Stop scanning
await ZebraRfidReader.stopInventory();

📚 Main Functions #

Core Methods #

Method Description
initialize() Initialize the Zebra RFID SDK
getAllAvailableReaders() Get list of available RFID readers
connect({String? readerName}) Connect to RFID reader (auto-selects if name not provided)
disconnect() Disconnect from current reader
isConnected() Check if reader is connected
startInventory() Start scanning for RFID tags
stopInventory() Stop tag scanning
setAntennaPower(int level) Set antenna power (0-270 dBm)
getAntennaPower() Get current antenna power level
getPlatformVersion() Get Android platform version

Event Stream #

Property Type Description
eventStream Stream<RfidEvent> Listen for real-time RFID events

📋 Models & Classes #

Models (lib/src/models/) #

RfidEvent - RFID event representation

Properties:

  • type - Event type (tagRead, trigger, connected, disconnected, error)
  • tags - List of scanned tags (for tagRead events)
  • triggerPressed - Trigger state (for trigger events)
  • errorMessage - Error description (for error events)
  • readerName - Reader name (for connection events)
RfidTag - Scanned RFID tag

Properties:

  • tagId - EPC tag identifier
  • rssi - Signal strength (dBm)
  • antennaId - Antenna that detected the tag
  • count - Number of times tag was read

Services (lib/src/services/) #

ZebraRfidReader - Main service class

Key Features:

  • SDK initialization and lifecycle management
  • Reader connection and configuration
  • Tag inventory operations
  • Antenna power control
  • Event streaming with full logging
AppLogger - Logging utility

Features:

  • Multi-level logging (debug, info, warning, error, critical)
  • In-memory log storage (max 500 entries)
  • Export logs to clipboard
  • Real-time log updates via ChangeNotifier

UI Screens (lib/src/screens/) #

LogViewerScreen - Debug log viewer

Features:

  • Color-coded log levels
  • Filter by log level
  • Auto-scroll toggle
  • Copy logs to clipboard
  • Clear log history
  • Expandable entries with error details

🎯 Event Types #

enum RfidEventType {
  tagRead,          // Tags were scanned
  trigger,          // Hardware trigger pressed/released
  connected,        // Reader connected
  disconnected,     // Reader disconnected
  readerAppeared,   // New reader detected
  readerDisappeared,// Reader removed
  initialized,      // SDK initialized
  error,            // Error occurred
  unknown,          // Unknown event
}

🛠️ Requirements #

  • Device: Zebra TC27 or compatible Zebra RFID device
  • Android: API 26+ (Android 8.0+) with full Android 13+ support
  • Flutter: 3.3.0+
  • Dart: 3.0.0+

⚠️ Note: Requires actual Zebra RFID hardware. Will not work in emulators.


🔧 Troubleshooting #

❌ Build Error: "Could not find com.zebra.rfid:rfid-api3:2.0.5.238"

Solution: You forgot to add the Maven repository! See the Android Configuration section above.

🔍 No Readers Found

Solutions:

  • Ensure Bluetooth is enabled
  • Run on actual Zebra device (not emulator)
  • Grant all required permissions
  • Restart the device
🔌 Connection Failed

Solutions:

  • Check reader is powered on
  • Verify Bluetooth connection
  • Ensure no other app is using the reader
  • Try disconnecting and reconnecting

📖 API Documentation #

For complete API documentation, visit: pub.dev/documentation/rfid_zebra_reader


🤝 Contributing #

Contributions are welcome! Please read our Contributing Guidelines before submitting a PR.


👨‍💻 Author #

Jimmy (@devJimmy990)


🙏 Acknowledgments #

  • Built with Zebra RFID SDK v2.0.5.238
  • Designed for Zebra TC27 and compatible devices
  • Special thanks to the Flutter community

📞 Support #


⭐ If this plugin helped you, please star the repo!


Made with ❤️ by devJimmy990

5
likes
150
points
95
downloads

Publisher

unverified uploader

Weekly Downloads

plugin to interact with Zebra RFID readers

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on rfid_zebra_reader

Packages that implement rfid_zebra_reader