mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-27 13:59:21 +00:00
20 lines
500 B
Dart
20 lines
500 B
Dart
|
import 'package:barcode_scan2/barcode_scan2.dart';
|
||
|
|
||
|
abstract class BarcodeScannerInterface {
|
||
|
Future<ScanResult> scan({ScanOptions options = const ScanOptions()});
|
||
|
}
|
||
|
|
||
|
class BarcodeScannerWrapper implements BarcodeScannerInterface {
|
||
|
const BarcodeScannerWrapper();
|
||
|
|
||
|
@override
|
||
|
Future<ScanResult> scan({ScanOptions options = const ScanOptions()}) async {
|
||
|
try {
|
||
|
final result = await BarcodeScanner.scan(options: options);
|
||
|
return result;
|
||
|
} catch (e) {
|
||
|
rethrow;
|
||
|
}
|
||
|
}
|
||
|
}
|