zebra_scan_datawedge 0.0.2 copy "zebra_scan_datawedge: ^0.0.2" to clipboard
zebra_scan_datawedge: ^0.0.2 copied to clipboard

PlatformAndroid

The `ZebraDataWedge` plugin is a Flutter interface for interacting with Zebra's DataWedge, enabling you to create and configure a DataWedge profile, start/stop scanning

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:zebra_scan_datawedge/zebra_datawedge.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 zebraSdk = ZebraDataWedge();

  @override
  void initState() {
    super.initState();
    zebraSdk.initialized();
    zebraSdk.createDataWedgeProfile(profileName: "TejasG_Prod");
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Zebra SDK Plugin'),
        ),
        body: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Container(
              margin: const EdgeInsets.all(20),
              decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.circular(20),
                  border: Border.all(color: Colors.grey)),
              child: Column(
                children: [
                  Padding(
                    padding: const EdgeInsets.all(20.0),
                    child: Center(
                      child: StreamBuilder(
                          stream: zebraSdk.getStreamOfData,
                          builder: (context, snap) {
                            if (snap.hasData) {
                              return Text(
                                snap.data ?? "No Data Available",
                                style: const TextStyle(
                                    fontWeight: FontWeight.bold),
                              );
                            } else {
                              return const Text(
                                "Scan new data...",
                                style: TextStyle(
                                    fontWeight: FontWeight.normal,
                                    color: Colors.grey),
                              );
                            }
                          }),
                    ),
                  ),
                  const Divider(
                    height: 1,
                  ),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceAround,
                    children: [
                      Column(
                        children: [
                          TextButton(
                              onPressed: zebraSdk.startScan,
                              child: const Text("Start Scan")),
                          TextButton(
                              onPressed: zebraSdk.stopScan,
                              child: const Text("Stop Scan")),
                        ],
                      ),
                      Column(
                        children: [
                          TextButton(
                              onPressed: zebraSdk.disableDataWedge,
                              child: const Text("Disable Data Wedge")),
                          TextButton(
                              onPressed: zebraSdk.enableDataWedge,
                              child: const Text("Enable Data Wedge")),
                        ],
                      )
                    ],
                  )
                ],
              ),
            )
          ],
        ),
      ),
    );
  }
}
1
likes
140
points
24
downloads

Publisher

verified publishertejasgprod.online

Weekly Downloads

The `ZebraDataWedge` plugin is a Flutter interface for interacting with Zebra's DataWedge, enabling you to create and configure a DataWedge profile, start/stop scanning

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on zebra_scan_datawedge