Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/okadan/dart-ndef-record
A Dart implementation of the NFC Data Exchange Format (NDEF) specification.
https://github.com/okadan/dart-ndef-record
Last synced: about 2 months ago
JSON representation
A Dart implementation of the NFC Data Exchange Format (NDEF) specification.
- Host: GitHub
- URL: https://github.com/okadan/dart-ndef-record
- Owner: okadan
- License: mit
- Created: 2023-10-04T12:40:32.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-07T13:40:06.000Z (8 months ago)
- Last Synced: 2024-05-07T14:47:25.823Z (8 months ago)
- Language: Dart
- Homepage: https://pub.dev/packages/ndef_record
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ndef_record
A Dart implementation of the NFC Data Exchange Format (NDEF) specification.
## Example
Currently this package only provides the low-level API of the NDEF specification, so you will need to implement encoding/decoding of byte data yourself.
```dart
// Well-Known Record (RTD:T)
NdefRecord(
typeNameFormat: TypeNameFormat.wellKnown,
type: ascii.encode('T'),
identifier: Uint8List(0),
payload: Uint8List.fromList([
0x02,
...ascii.encode('en'),
...ascii.encode('Hello'),
]),
);// Well-Known Record (RTD:U)
NdefRecord(
typeNameFormat: TypeNameFormat.wellKnown,
type: ascii.encode('U'),
identifier: Uint8List(0),
payload: Uint8List.fromList([
0x03,
...utf8.encode('example.com'),
]),
);// Mime Record
NdefRecord(
typeNameFormat: TypeNameFormat.media,
type: ascii.encode('text/plain'),
identifier: Uint8List(0),
payload: ascii.encode('Hello'),
);// External Record (Android Application)
NdefRecord(
typeNameFormat: TypeNameFormat.external,
type: ascii.encode('android.com:pkg'),
identifier: Uint8List(0),
payload: utf8.encode('example'),
);// and more...
```