pax_nfc 0.0.1 copy "pax_nfc: ^0.0.1" to clipboard
pax_nfc: ^0.0.1 copied to clipboard

A plugin to use NFC on pax devices

example/lib/main.dart

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

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final _paxNfcPlugin = PaxNfc();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            StreamBuilder(
              stream: _paxNfcPlugin.listenNfcStream(),
              builder: (context, snapshot) {
                if (snapshot.hasData) {
                  return Text('${snapshot.data}');
                } else {
                  return const CircularProgressIndicator();
                }
              },
            ),
            Row(
              children: [
                ElevatedButton(
                  onPressed: () => _paxNfcPlugin.startNfcDetectionThreads(),
                  child: const Text("démarrer les threads"),
                ),
                ElevatedButton(
                  onPressed: () => _paxNfcPlugin.stopNfcDetectionThreads(),
                  child: const Text("arrêter les threads"),
                )
              ],
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
0
points
114
downloads

Publisher

unverified uploader

Weekly Downloads

A plugin to use NFC on pax devices

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on pax_nfc

Packages that implement pax_nfc