nfc_antenna_info_flutter
A Flutter plugin for retrieving precise NFC antenna information to accurately locate NFC chips on Android 14 and newer devices.
Features
Provides a straightforward API to gather detailed information about all available NFC antennas on Android devices. It also delivers device-specific details relevant to the positioning of antennas.
Requirements
- Flutter >=3.24.0
- Dart >=3.5.0
- Android
compileSDK34 - Java 17
- Android Gradle Plugin >=8.2.0
- Gradle wrapper >=8.3
Public Methods
| Return Type | Method Name | Description | Throws |
|---|---|---|---|
Future<NfcAntennaResponse> |
getNfcAntennaInfo |
Gets the NFC antenna information. | - UnsupportedFeatureException if the platform does not support feature. - NfcUnavailableException if NFC is not available on the device. - NfcDisabledException if NFC is disabled on the device. |
Parameters of the NfcAntennaResponse:
| Type | Parameter Name | Description |
|---|---|---|
| int | deviceWidth |
Width of the device in millimeters. |
| int | deviceHeight |
Height of the device in millimeters. |
| bool | deviceFoldable |
Whether the device is foldable. |
List<NfcAntenna> |
availableNfcAntennas |
All available Nfc Antennas on the device. |
Parameters of the NfcAntenna:
| Type | Parameter Name | Description |
|---|---|---|
| int | locationX |
Location of the antenna on the X axis in millimeters. 0 is the top-left when the user is facing the screen and the device orientation is Portrait. |
| int | locationY |
Location of the antenna on the Y axis in millimeters. 0 is the top-left when the user is facing the screen and the device orientation is Portrait. |
Example
More examples can be found in /example folder on GitHub.
Feature requests and bugs
Please file feature requests and bugs at the issue tracker.
Maintainers
Libraries
- nfc_antenna_info_flutter
- A Flutter plugin to get the NFC antenna information on Android. Provided information makes it possible to locate the NFC antenna on the device.