flutter_datalogic 1.0.2 copy "flutter_datalogic: ^1.0.2" to clipboard
flutter_datalogic: ^1.0.2 copied to clipboard

outdated

A Flutter package communicate with Datalogic scanners.

example/lib/main.dart

import 'dart:async';

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

void main() => runApp(MaterialApp(home: const ExampleApp()));

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

  @override
  State<ExampleApp> createState() => _ExampleAppState();
}

class _ExampleAppState extends State<ExampleApp> {
  late StreamSubscription onScanSubscription;

  var scannedBarcode = 'Press Scan button on device';

  @override
  void initState() {
    FlutterDatalogic dl = FlutterDatalogic();
    onScanSubscription = dl.onScanResult.listen((result) {
      setState(() {
        scannedBarcode = result.data;
      });
    });
    super.initState();
  }

  @override
  void dispose() {
    onScanSubscription.cancel();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('Datalogic demo')),
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            Text(
              scannedBarcode,
              textAlign: TextAlign.center,
            ),
            // TextButton(onPressed: _scan, child: Text('Scan')),
          ],
        ),
      ),
    );
  }

  void _scan() {
  }
}
4
likes
0
points
10
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package communicate with Datalogic scanners.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, freezed_annotation, freezed_result, json_annotation

More

Packages that depend on flutter_datalogic

Packages that implement flutter_datalogic