scanCode static method
Future<String?>
scanCode({
- required BarcodeFormat typeOfCode,
- required BuildContext context,
- Widget? title,
- bool centerTitle = false,
- Color foregroundColor = Colors.black,
- Color backgroundColor = Colors.white,
Scan some type of BarCode like QR code, etc.
Implementation
static Future<String?> scanCode({
required BarcodeFormat typeOfCode,
required BuildContext context,
///Goes on the appbar
Widget? title,
final bool centerTitle = false,
final Color foregroundColor = Colors.black,
final Color backgroundColor = Colors.white,
})async{
String? data = await Navigator.push(context, MaterialPageRoute(
builder: (context)=> Scanner(
typeOfCode: typeOfCode,
foregroundColor: foregroundColor,
backgroundColor: backgroundColor,
title: title,
centerTitle: centerTitle,
),
),
);
//Return the QR code result, might be null
return data;
}