flutter_nfc_compatibility

Creator: coderz1093

Last updated:

Add to Cart

Description:

flutter nfc compatibility

Flutter NFC Compatibility Check #
Installation #
Add to pubspec.yaml:
dependencies:
flutter_nfc_compatibility: ^0.0.3
copied to clipboard
import 'package:flutter_nfc_compatibility/flutter_nfc_compatibility.dart';
copied to clipboard
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" />
copied to clipboard
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";
}

copied to clipboard
NFCAvailability can differentiate the states of the NFC

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files:

Customer Reviews

There are no reviews.