flutter_nfc_compatibility 0.0.4 copy "flutter_nfc_compatibility: ^0.0.4" to clipboard
flutter_nfc_compatibility: ^0.0.4 copied to clipboard

PlatformAndroid

A nfc compatibility plugin for Android. It will differentiate States of NFC (Not Enabled, Not Supported, Enabled)

Flutter NFC Compatibility Check #

Installation #

Add to pubspec.yaml:

dependencies:
  flutter_nfc_compatibility: ^0.0.3
import 'package:flutter_nfc_compatibility/flutter_nfc_compatibility.dart';

How to use #

Android setup #

Add those two lines to your AndroidManifest.xml on the top

<uses-permission android:name="android.permission.NFC" />
<uses-feature
        android:name="android.hardware.nfc"
        android:required="true" />

Usage #

Handling Session

// Check availability
var nfcCompatibility = await FlutterNfcCompatibility.checkNFCAvailability();

// Different states of the NFC availibality
if(nfcCompatibility == NFCAvailability.Enabled ){
   writerController.text = "Enabled";
}else if(nfcCompatibility == NFCAvailability.Disabled ){
   writerController.text = "Disabled";
}else{
   writerController.text = "Not Supported";
}

NFCAvailability can differentiate the states of the NFC

3
likes
130
pub points
64%
popularity

Publisher

verified publishermymax.uz

A nfc compatibility plugin for Android. It will differentiate States of NFC (Not Enabled, Not Supported, Enabled)

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_nfc_compatibility