fix: fixed a bug that would cause empty scanned barcodes to be treated as no-empty
This commit is contained in:
parent
587cc0689a
commit
aa3fda9c88
2 changed files with 6 additions and 0 deletions
|
|
@ -80,6 +80,9 @@ class _AddPageState extends State<AddPage> {
|
|||
MobileScanner(
|
||||
controller: controller,
|
||||
onDetect: (barcodes) async {
|
||||
if (barcodes.barcodes.isEmpty) {
|
||||
return;
|
||||
}
|
||||
if (widget.viewModel.currentOwner == null) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
|
|
|
|||
|
|
@ -41,6 +41,9 @@ class _ScanScreenState extends State<ScanScreen> {
|
|||
MobileScanner(
|
||||
controller: controller,
|
||||
onDetect: (barcodes) async {
|
||||
if (barcodes.barcodes.isEmpty) {
|
||||
return;
|
||||
}
|
||||
controller.stop();
|
||||
showDialog(
|
||||
context: context,
|
||||
|
|
|
|||
Reference in a new issue