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(
|
MobileScanner(
|
||||||
controller: controller,
|
controller: controller,
|
||||||
onDetect: (barcodes) async {
|
onDetect: (barcodes) async {
|
||||||
|
if (barcodes.barcodes.isEmpty) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (widget.viewModel.currentOwner == null) {
|
if (widget.viewModel.currentOwner == null) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,9 @@ class _ScanScreenState extends State<ScanScreen> {
|
||||||
MobileScanner(
|
MobileScanner(
|
||||||
controller: controller,
|
controller: controller,
|
||||||
onDetect: (barcodes) async {
|
onDetect: (barcodes) async {
|
||||||
|
if (barcodes.barcodes.isEmpty) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
controller.stop();
|
controller.stop();
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
|
|
||||||
Reference in a new issue