openForCode static method

Future<UCode?> openForCode({
  1. String? title,
  2. List<UCodeFormat> formats = const <UCodeFormat>[],
  3. String? hintText,
})

Pushes this page and awaits the full result, with format and geometry.

Implementation

static Future<UCode?> openForCode({String? title, List<UCodeFormat> formats = const <UCodeFormat>[], String? hintText}) async {
  UCode? scanned;
  await UNavigator.push<String>(
    UScannerPage(
      title: title,
      formats: formats,
      hintText: hintText,
      onCodes: (List<UCode> codes) => scanned = codes.isEmpty ? null : codes.first,
    ),
  );
  return scanned;
}