import 'package:bluetooth_print_plus/bluetooth_print_plus.dart'; import 'package:mobile_pos/Screens/Products/Model/product_model.dart'; class SalesThermalLabels { ///________Sales____________________ Future printLabels({required List? productList}) async { bool conn = BluetoothPrintPlus.isConnected; print('Collection State----------------> $conn'); ///_________________Old_______________________________________________ // bool? isConnected = await PrintBluetoothThermal.connectionStatus; // if (isConnected == true) { // List bytes = await labelPrinter(productList: productList); // if (true) { // await PrintBluetoothThermal.writeBytes(bytes); // EasyLoading.showSuccess('Successfully Printed'); // } else { // toast('No Product Found'); // } // } else { // EasyLoading.showError('Unable to connect with printer'); // } } // // Future> labelPrinter({required List? productList}) async { // List bytes = []; // CapabilityProfile profile = await CapabilityProfile.load(); // // final generator = Generator(PaperSize.mm80, profile); // // ///____________Header_____________________________________ // bytes += generator.text('This is a test', // styles: const PosStyles( // align: PosAlign.center, // height: PosTextSize.size2, // width: PosTextSize.size2, // ), // linesAfter: 1); // final List barData = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 4]; // bytes += generator.barcode(Barcode.upcA(barData)); // // bytes += generator.cut(); // return bytes; // } }