barcode_newland_flutter 1.0.1 copy "barcode_newland_flutter: ^1.0.1" to clipboard
barcode_newland_flutter: ^1.0.1 copied to clipboard

PlatformAndroid

A simple and easy wrapper for the Newland Scanner Android SDK. Easily scan barcodes with Flutter and Newland Devices.

example/lib/main.dart

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

import 'package:barcode_newland_flutter/newland_scan_result.dart';
import 'package:barcode_newland_flutter/newland_scanner.dart';

/// Runs the MyApp widget as the main entry point of the application.
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> {
  late Stream<NewlandScanResult> _stream;

  @override
  void initState() {
    super.initState();

    _stream = Newlandscanner.listenForBarcodes;
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: StreamBuilder<NewlandScanResult>(
              stream: _stream,
              builder: (context, snapshot) {
                if (snapshot.hasData) {
                  final data = snapshot.data!;

                  return Text('Scanned barcode: ${data.barcodeData}');
                }

                return const Text('Waiting for Data');
              }),
        ),
      ),
    );
  }
}
4
likes
160
points
38
downloads

Publisher

unverified uploader

Weekly Downloads

A simple and easy wrapper for the Newland Scanner Android SDK. Easily scan barcodes with Flutter and Newland Devices.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on barcode_newland_flutter

Packages that implement barcode_newland_flutter