nfc_manager 0.5.0 copy "nfc_manager: ^0.5.0" to clipboard
nfc_manager: ^0.5.0 copied to clipboard

outdated

A Flutter plugin to use NFC. Supported on both Android and iOS.

example/lib/main.dart

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

import './read.dart';
import './write.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('NfcManager Example')),
        body: SafeArea(
          child: FutureBuilder<bool>(
            future: NfcManager.isAvailable(NfcSessionType.ndef),
            builder: (context, ss) {
              if (!ss.hasData) return Container();
              if (!ss.data)  return Center(child: Text('Not available on the current device'));
              return ListView(
                children: [
                  ListTile(
                    title: Text('Read'),
                    onTap: () => Navigator.push(context, MaterialPageRoute(
                      builder: (_) => ReadPage(),
                    )),
                  ),
                  ListTile(
                    title: Text('Write'),
                    onTap: () => Navigator.push(context, MaterialPageRoute(
                      builder: (_) => WritePage(),
                    )),
                  ),
                ],
              );
            },
          ),
        ),
      ),
    );
  }
}
416
likes
0
pub points
98%
popularity

Publisher

verified publisherokadan.net

A Flutter plugin to use NFC. Supported on both Android and iOS.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on nfc_manager