generateQrCode method

  1. @override
Future<Uint8List> generateQrCode(
  1. String data,
  2. QrGenerationOptions options
)
override

Generates a QR code with the given data and options

Implementation

@override
Future<Uint8List> generateQrCode(
  String data,
  QrGenerationOptions options,
) async {
  try {
    final result = await methodChannel.invokeMethod<Uint8List>(
      'generateQrCode',
      {'data': data, ...options.toJson()},
    );

    if (result == null) {
      throw const QrScannerException('Failed to generate QR code');
    }

    return result;
  } on PlatformException catch (e) {
    throw _handlePlatformException(e);
  }
}