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

Future<String> barcodeScan(BuildContext context) async {
  String? barcode = await SimpleBarcodeScanner.scanBarcode(
    context,
    // barcodeAppBar: const BarcodeAppBar(
    //     // appBarTitle: 'Test',
    //     // centerTitle: false,
    //     // enableBackButton: false,
    //     // backButtonIcon: Icon(Icons.arrow_back_ios),
    //     ),
    // isShowFlashIcon: true,
    delayMillis: 2000,
    scanType: ScanType.barcode,
    cameraFace: CameraFace.back,
  );
  return barcode != '-1' ? barcode ?? '' : '';
}
