Skip to content

Instantly share code, notes, and snippets.

@r-yeates
Created March 14, 2022 22:04
Show Gist options
  • Select an option

  • Save r-yeates/f3008cc2653fda98896b95635708f629 to your computer and use it in GitHub Desktop.

Select an option

Save r-yeates/f3008cc2653fda98896b95635708f629 to your computer and use it in GitHub Desktop.
import 'package:mobile_scanner/mobile_scanner.dart';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Mobile Scanner')),
body: MobileScanner(
allowDuplicates: false,
onDetect: (barcode, args) {
final String? code = barcode.rawValue;
debugPrint('Barcode found! $code');
}),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment