feat: suite de tiendas, sync reactivo, bitácora de errores y alertas whatsapp

This commit is contained in:
Pablinux
2026-11-22 17:41:18 -05:00
parent cc4ab12d1d
commit 6a5ebb907d
76 changed files with 2975 additions and 312 deletions
+14 -15
View File
@@ -20,10 +20,12 @@ class _ScannerScreenState extends State<ScannerScreen> {
super.dispose();
}
void _onDetect(Barcode barcode, MobileScannerArguments? args) {
if (_scanned || barcode.rawValue == null || barcode.rawValue!.isEmpty) return;
void _onDetect(BarcodeCapture capture) {
if (_scanned || capture.barcodes.isEmpty) return;
final rawValue = capture.barcodes.first.rawValue;
if (rawValue == null || rawValue.isEmpty) return;
_scanned = true;
Navigator.pop(context, barcode.rawValue);
Navigator.pop(context, rawValue);
}
@override
@@ -36,24 +38,21 @@ class _ScannerScreenState extends State<ScannerScreen> {
elevation: 0,
title: Text(widget.titulo),
actions: [
ValueListenableBuilder<TorchState>(
valueListenable: _controller.torchState,
ValueListenableBuilder<MobileScannerState>(
valueListenable: _controller,
builder: (_, state, __) => IconButton(
tooltip: state == TorchState.on ? 'Apagar linterna' : 'Encender linterna',
tooltip: state.torchState == TorchState.on ? 'Apagar linterna' : 'Encender linterna',
icon: Icon(
state == TorchState.on ? Icons.flash_on : Icons.flash_off,
color: state == TorchState.on ? Colors.yellow : Colors.white,
state.torchState == TorchState.on ? Icons.flash_on : Icons.flash_off,
color: state.torchState == TorchState.on ? Colors.yellow : Colors.white,
),
onPressed: _controller.toggleTorch,
),
),
ValueListenableBuilder<CameraFacing>(
valueListenable: _controller.cameraFacingState,
builder: (_, facing, __) => IconButton(
tooltip: 'Cambiar cámara',
icon: const Icon(Icons.cameraswitch, color: Colors.white),
onPressed: _controller.switchCamera,
),
IconButton(
tooltip: 'Cambiar cámara',
icon: const Icon(Icons.cameraswitch, color: Colors.white),
onPressed: () => _controller.switchCamera(),
),
],
),