간편하게 QR 코드를 렌더링할 수 있는 매우 사용자 정의 가능한 Flutter 위젯입니다. 크기, 색상, 모양 및 로고 통합 옵션을 통해 QR 코드의 외관을 맞춤 설정할 수 있습니다. Android, iOS, Web, macOS, Windows, Linux 등 여러 플랫폼을 지원하여 크로스플랫폼 애플리케이션에 적합합니다. 깔끔한 API와 내장된 스타일 기능으로 외부 종속성 없이 QR 코드 생성을 간소화합니다. 브랜드화 또는 인터랙티브한 QR 코드가 필요한 앱에 이상적입니다.
사용 사례
브랜드 QR 코드 생성
QR 코드에 로고 추가하기
웹 및 모바일 앱에 QR 코드 삽입
동적 QR 코드 생성
다시보드에서 QR 코드 표시
주요 기능
사용자 지정 가능한 색상 및 크기
로고 오버레이 지원
크로스 플랫폼 호환성
간단한 API
높은 구성 가능성을 가진 디자인
내장 오류 보정
적합한 대상
모바일 앱 개발자
웹 애플리케이션 제작자
디자인 중심 프로젝트
전자상거래 및 마케팅 앱
사용자 생성 QR 코드가 필요한 앱
고려 사항
대용량 배치에 대한 성능 최적화가 필요할 수 있습니다
제한된 고급 QR 데이터 인코딩 옵션
로고 크기 조정은 가독성에 영향을 줄 수 있습니다
고용량 QR 생성에 적합하지 않습니다
플랫폼 고유의 렌더링 기능에 의존합니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Pretty QR Code
A highly customizable Flutter widget that makes it easy to render QR codes. Built on top of the qr package.
Shapes - The widget provides functionality for rendering various built-in shapes, namely smooth, squares and dots, or you can even create your patterns using the package API.
PrettyQrView.data(
data: 'lorem ipsum dolor sit amet',
decoration: constPrettyQrDecoration(
image: PrettyQrDecorationImage(
image: AssetImage('images/flutter.png'),
),
quietZone: PrettyQrQuietZone.standart,
),
)
If you want to pass non-string data or want to specify a QR version, consider using the default PrettyQrView constructor:
@protectedlateQrImage qrImage;
@overridevoidinitState() {
super.initState();
final qrCode = QrCode(
8,
QrErrorCorrectLevel.H,
)..addData('lorem ipsum dolor sit amet');
qrImage = QrImage(qrCode);
}
@overrideWidgetbuild(BuildContext context) {
returnPrettyQrView(
qrImage: qrImage,
decoration: constPrettyQrDecoration(),
);
}
Note: Do not create QrImage inside the build method; otherwise, you may have an undesired jank in the UI thread.
Combine several styles
To combine multiple styles in a single QR code, you can use PrettyQrCustomShape, as shown in the example below:
PrettyQrView.data(
data: 'lorem ipsum dolor sit amet',
decoration: constPrettyQrDecoration(
shape: PrettyQrShape.custom(
PrettyQrSquaresSymbol(),
finderPattern: PrettyQrSmoothSymbol(),
alignmentPatterns: PrettyQrDotsSymbol(),
),
),
)
Save the symbol as an image
You can save the QR code as an image using the toImage or toImageAsBytes extension methods that apply to QrImage. Optionally, the configuration parameter may be used to set additional saving options, such as pixel ratio or text direction.
final qrCode = QrCode.fromData(
data: 'lorem ipsum dolor sit amet',
errorCorrectLevel: QrErrorCorrectLevel.H,
);
final qrImage = QrImage(qrCode);
final qrImageBytes = await qrImage.toImageAsBytes(
size: 512,
format: ImageByteFormat.png,
decoration: constPrettyQrDecoration(),
);
See the example folder for more code samples of the various possibilities.
Contributing
Contributions are welcomed!
Here is a curated list of how you can help:
Fix typos/grammar mistakes
Report parts of the documentation that are unclear
Report bugs and scenarios that are difficult to implement