cute_qr_code library
Aesthetic QR code generation for Flutter (ported from qrcode-kotlin). 美观 QR 码生成库(移植自 qrcode-kotlin)。
Classes
- CircleShapeFunction
- Circular modules (full module radius). 圆形模块(半径等于模块尺寸)。
- CuteQrCode
- Widget that displays a styled QR code, scaling to the parent constraints. 显示样式化 QR 码的组件,按父级约束缩放。
- CuteQrCodeView
- Displays a prepared QrCode scaled to parent constraints. 将已准备的 QrCode 按父级约束缩放显示。
- CuteQrDataView
- Encodes data and displays the resulting QrCode with error handling. 编码 data 并显示得到的 QrCode,含错误处理。
- CuteQrRenderView
- Render object that displays a QrCode scaled to the smallest parent constraint side. 将 QrCode 缩放至父级约束最短边的渲染对象。
- DefaultColorFunction
- Solid foreground and background colors for all modules. 所有模块使用固定前景与背景色。
- DefaultShapeFunction
- Square modules with optional inner padding. 方形模块,可选内边距。
- LinearGradientColorFunction
- Linear gradient across dark modules; solid background. 深色模块线性渐变;背景为纯色。
- QrCode
- Encoded and styled QR symbol with rendering helpers. 已编码且可样式化的 QR 符号,提供渲染辅助方法。
- QrCodeColorFunction
- Strategy for foreground and background colors per module. 按模块决定前景与背景色的策略。
- QrCodeConfig
- Style and encoding options for QrCode.create and CuteQrCode. QrCode.create 与 CuteQrCode 的样式与编码配置。
- QrCodeGraphics
- Picture-recorder-backed canvas for QR raster output. 基于 PictureRecorder 的 QR 光栅输出画布。
- QrCodeGraphicsFactory
- Creates QrCodeGraphics buffers for rendering. 创建用于渲染的 QrCodeGraphics 缓冲区。
- QrCodePainter
- CustomPainter that scales qrCode via QrCode.paintOntoCanvas. 通过 QrCode.paintOntoCanvas 缩放绘制 qrCode 的 CustomPainter。
- QrCodeProcessor
- Encodes payload strings into QR matrices and can render flat graphics. 将载荷字符串编码为 QR 矩阵,并可渲染为平面图形。
- QrCodeShapeFunction
- Draws individual modules and control patterns onto QrCodeGraphics. 将各模块与控制图案绘制到 QrCodeGraphics。
- QrCodeSquare
- Single QR module (dark/light) with layout and render state. 单个 QR 模块(深/浅),含布局与渲染状态。
- RoundSquaresShapeFunction
- Rounded-square modules derived from DefaultShapeFunction. 基于 DefaultShapeFunction 的圆角方形模块。
Enums
- ErrorCorrectionLevel
- QR error correction level (maps to ISO L/M/Q/H). QR 纠错等级(对应 ISO L/M/Q/H)。
- MaskPattern
- Mask pattern applied to the QR matrix (8 variants). 应用于 QR 矩阵的掩码模式(8 种)。
- QrCodeDataType
- Payload encoding mode for QR data segments. QR 数据段的编码模式。
- QrCodeShapesEnum
- Module shape preset for QrCodeConfig.shape. QrCodeConfig.shape 使用的模块形状预设。
- QrCodeSquareType
- Functional role of a module in the QR symbol. QR 符号中模块的功能角色。
Functions
-
cuteQrCodeToPng(
String data, {QrCodeConfig config = const QrCodeConfig()}) → Future< Uint8List> -
Encodes
dataand returns PNG bytes. 编码data并返回 PNG 字节。 -
emptyQrCodeHook(
QrCode qr, QrCodeGraphics g, int x, int y) → void - No-op hook used as default. 默认空操作钩子。
Typedefs
- QrCodeHook = void Function(QrCode qr, QrCodeGraphics g, int x, int y)
- Callback invoked before or after rendering onto QrCodeGraphics. 在 QrCodeGraphics 上渲染前后调用的钩子。
-
QrCodeRawData
= List<
List< QrCodeSquare> > - Encoded QR matrix: rows of QrCodeSquare modules. 编码后的 QR 矩阵:由 QrCodeSquare 模块组成的行列表。
Exceptions / Errors
- InsufficientInformationDensityException
- Thrown when payload exceeds the chosen QR version capacity. 当载荷超过所选 QR 版本容量时抛出。