pda_608_plugin 0.0.7 copy "pda_608_plugin: ^0.0.7" to clipboard
pda_608_plugin: ^0.0.7 copied to clipboard

unlisted

A plugin for PDA608 hardware

example/lib/main.dart

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

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

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

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

class _MyAppState extends State<MyApp> {
  String _scanResult = 'No barcode scanned yet';

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('PDA608 Plugin Example'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text('Scan Result: $_scanResult'),
              const SizedBox(height: 20),
              ElevatedButton(
                onPressed: _scanBarcode,
                child: const Text('Scan Barcode'),
              ),
            ],
          ),
        ),
      ),
    );
  }

  Future<void> _scanBarcode() async {
    try {
      final String? result = await Pda608Plugin.scanBarcode();
      setState(() {
        _scanResult = result ?? 'Scan failed or was cancelled';
      });
    } catch (e) {
      setState(() {
        _scanResult = 'Error: $e';
      });
    }
  }
}
0
likes
0
points
609
downloads

Publisher

unverified uploader

Weekly Downloads

A plugin for PDA608 hardware

Homepage

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on pda_608_plugin

Packages that implement pda_608_plugin