Pakete, Repositories und App-Kategorien suchen

Paketdetailsv3.7.0

flutter_nfc_kit

Bieten Sie NFC-Funktionalität für Android, iOS und Web an, einschließlich Lesevorgänge von Metadaten, Lesen und Schreiben von NDEF-Datensätzen sowie Austausch von Daten auf Ebene 3 und 4 mit NFC-Tags/Karten

AndroidiOSWeb
30-Tage-Downloads
86.200
Likes
280
Pub-Punkte
160

Paket installieren

flutter pub add flutter_nfc_kit

Paketübersicht

Aus öffentlichen Paketdaten erstellte Orientierung.

flutter_nfc_kit ist ein plattformübergreifendes Flutter-Paket, das NFC-Funktionen auf Android, iOS und Web ermöglicht. Es ermöglicht Entwicklern das Lesen und Schreiben von NDEF-Datensätzen, den Zugriff auf Metadaten von NFC-Tags sowie Low-Level-Transceive-Operationen auf Ebene 3 und 4. Das Paket unterstützt eine Vielzahl von NFC-Anwendungsfällen, darunter kontaktlose Datenübertragung, Interaktion mit Smart Tags und sichere Kommunikation mit NFC-Karten. Durch eine konsistente API über Plattformen hinweg vereinfacht es die Integration von NFC-Funktionen in Flutter-Anwendungen.

Anwendungsfälle

  • Lesen und Schreiben von NDEF-Daten
  • Zugriff auf NFC-Tag-Metadaten
  • Ausführen der niedrigen NFC-Kommunikation
  • Kontaktlose Zahlungs- oder Ticketanwendungen erstellen
  • Smart Poster-Interaktionen aktivieren
  • Integration mit NFC-fähigen IoT-Geräten

Hauptmerkmale

  • Plattformübergreifende Unterstützung (Android, iOS, Web)
  • Lesen und Schreiben von NDEF-Datensätzen
  • Metadatenextraktion aus NFC-Tags
  • Layer-3- und Layer-4-Transceive-Funktionen
  • Konsistente API über Plattformen hinweg
  • Echtzeit-NFC-Tag-Erkennung

Geeignet für

  • Entwickler, die NFC-basierte mobile Apps entwickeln
  • Anwendungen, die kontaktlose Datenübertragung erfordern
  • Intelligente Geräte-Interaktionssysteme
  • Event-Ticketing- und Zugangskontrolllösungen
  • IoT- und eingebettete Systemintegration

Hinweise

  • Benötigt ein Gerät mit NFC-Hardware
  • Berechtigungen müssen auf jeder Plattform behandelt werden
  • Web-Unterstützung beschränkt auf kompatible Browser
  • iOS erfordert die Konfiguration des Hintergrundmodus
  • Die Leistung kann je nach Gerät und Tag-Typ variieren
  • Beschränkte Unterstützung für erweiterte NFC-Protokolle

Original-README

Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.

Flutter NFC Kit

pub version Test Build Example App

Yet another plugin to provide NFC functionality on Android, iOS and browsers (by WebUSB, see below).

This plugin's functionalities include:

  • read metadata and read & write NDEF records of tags / cards complying with:
    • ISO 14443 Type A & Type B (NFC-A / NFC-B / MIFARE Classic / MIFARE Plus / MIFARE Ultralight / MIFARE DESFire)
    • ISO 18092 (NFC-F / FeliCa)
    • ISO 15693 (NFC-V)
  • R/W block / page / sector level data of tags complying with:
    • MIFARE Classic / Ultralight (Android only, MIFARE Classic Read & Write block for iOS)
    • ISO 15693 (iOS only)
  • transceive raw commands with tags / cards complying with:
    • ISO 7816 Smart Cards (layer 4, in APDUs)
    • other device-supported technologies (layer 3, in raw commands, see documentation for platform-specific supportability)

Note that due to API limitations, not all operations are supported on all platforms. You are welcome to submit PRs to add support for any standard-specific operations.

This library uses ndef for NDEF record encoding & decoding.

Contributing

Please refer to CONTRIBUTING.md for more information.

Setup

Android

We have the following minimum version requirements for Android plugin:

  • Java 17
  • Gradle 8.9
  • Android SDK 24 (you must set corresponding jvmTarget in you app's build.gradle)
  • Android Gradle Plugin 8.7

To use this plugin on Android, you also need to:

iOS

This plugin now supports Swift package manager, and requires iOS 13+.

Web

The web version of this plugin does not actually support NFC in browsers, but uses a specific WebUSB protocol, so that Flutter programs can communicate with dual-interface (NFC / USB) devices in a platform-independent way.

Make sure you understand the statement above and the protocol before using this plugin.

Usage

We provide simple code example and a example application.

Refer to the documentation for more information.

Error codes

We use error codes with similar meaning as HTTP status code. Brief explanation and error cause in string (if available) will also be returned when an error occurs.

Operation Mode

We provide two operation modes: polling (default) and event streaming. Both can give the same NFCTag object. Please see example for more details.

Performance Optimization (Android)

For Android applications, you can optimize NFC tag detection performance using the androidReaderModeFlags parameter:

// Skip automatic NDEF discovery for ~500ms faster detection
// and disable platform sounds for custom feedback
const flags = 0x80 | 0x100; // FLAG_READER_SKIP_NDEF_CHECK | FLAG_READER_NO_PLATFORM_SOUNDS

final tag = await FlutterNfcKit.poll(
  androidReaderModeFlags: flags,
);

Common flags from NfcAdapter:

  • 0x80 - FLAG_READER_SKIP_NDEF_CHECK: Skip automatic NDEF discovery, improving detection speed by ~500ms
  • 0x100 - FLAG_READER_NO_PLATFORM_SOUNDS: Disable system beep/vibration for custom audio/haptic feedback

These flags are particularly useful for applications that:

  • Need fast tag detection (e.g., access control, fast payments)
  • Implement custom user feedback instead of system sounds
  • Use custom NDEF reading logic instead of automatic discovery

Kategorien

Abhängigkeiten

Abhängigkeiten 6 Einträge

Quell-Repository

Projekte, die dieses Paket verwenden