Search packages, repositories and app categories

Package detailsv3.7.0

flutter_nfc_kit

Provide NFC functionality on Android, iOS & Web, including reading metadata, read & write NDEF records, and transceive layer 3 & 4 data with NFC tags / cards

AndroidiOSWeb
30-day downloads
86.2K
Likes
280
Pub points
160

Install package

flutter pub add flutter_nfc_kit

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

flutter_nfc_kit is a cross-platform Flutter package that enables NFC functionality on Android, iOS, and Web. It allows developers to read and write NDEF records, access metadata from NFC tags, and perform low-level transceive operations at layer 3 and 4. The package supports a wide range of NFC use cases, including contactless data exchange, smart tag interactions, and secure communication with NFC cards. With a consistent API across platforms, it simplifies integration of NFC features into Flutter applications.

Use cases

  • Reading and writing NDEF records
  • Accessing NFC tag metadata
  • Performing low-level NFC communication
  • Building contactless payment or ticketing apps
  • Enabling smart poster interactions
  • Integrating with NFC-enabled IoT devices

Key features

  • Cross-platform support (Android, iOS, Web)
  • NDEF record reading and writing
  • Metadata extraction from NFC tags
  • Layer 3 & 4 transceive capabilities
  • Consistent API across platforms
  • Real-time NFC tag detection

Suitable for

  • Developers building NFC-based mobile apps
  • Applications requiring contactless data transfer
  • Smart device interaction systems
  • Event ticketing and access control solutions
  • IoT and embedded system integrations

Considerations

  • Requires device with NFC hardware
  • Permissions must be handled on each platform
  • Web support limited to compatible browsers
  • iOS requires background mode configuration
  • Performance may vary by device and tag type
  • Limited support for advanced NFC protocols

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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

Categories

Dependencies

Dependency list 6 items

Source repository

Projects using this package