nfc_classic_mifare_plus 0.1.0 copy "nfc_classic_mifare_plus: ^0.1.0" to clipboard
nfc_classic_mifare_plus: ^0.1.0 copied to clipboard

PlatformAndroid

A Flutter plugin to interact with NFC Classic/Mifare Plus tags. Supports reading/writing blocks, changing passwords, and more.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:nfc_classic_mifare_plus/nfc_classic_mifare_plus.dart';

import 'example_page.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final isAvailable = NfcClassicMifarePlus.availability;
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: FutureBuilder(
        future: isAvailable,
        builder: (_, snapshot) {
          if (snapshot.connectionState == ConnectionState.done) {
            switch (snapshot.data) {
              case AVAILABILITY.AVAILABLE:
                return ExamplePage();

              case AVAILABILITY.NOT_ENABLED:
                return const Scaffold(
                  body: Center(child: Text('NFC Not Enabled.')),
                );

              case AVAILABILITY.NOT_SUPPORTED:
                return const Scaffold(
                  body: Center(child: Text('NFC Not Supported.')),
                );

              default:
                return const Scaffold(body: Center(child: Text('How?')));
            }
          } else {
            return Container();
          }
        },
      ),
    );
  }
}
1
likes
150
points
5
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin to interact with NFC Classic/Mifare Plus tags. Supports reading/writing blocks, changing passwords, and more.

Documentation

API reference

License

MIT (license)

Dependencies

flutter, logger, plugin_platform_interface

More

Packages that depend on nfc_classic_mifare_plus

Packages that implement nfc_classic_mifare_plus